STK_DoubleBarrier





http://www.QuantTools.com
CapeTools Stock Option Portfolio function list

Welcome | Documentation format | QuantTools Groups | QuantTools Categories | Licence

Key TAGs | Excel Index | API Index



A double barrier option is knocked in or out if the underlying price touches a lower boundary L or upper boundary U prior to expiration.

CO=Call up-and-out-down-and-out, PO=Put up-and-out-down-and-out, CI=Call up-and-in-down-and-in, PI=Put up-and-in-down-and-in. Alpha1 and Alpha2 determine the curvature of the lower L and Upper U absorbing boundaries.

When both are equal to 0, we have two flat boundaries.

Where Alpha1 is less than 0 and Alpha2 is greater than 0 we have a lower boundary exponentially growing as time elapses, while the upper boundary will be exponentially decaying.

An Alpha1 greater than 0 and Alpha2 less than 0 corresponds to a convex downward lower boundary and a convex upward upper boundary.

This function utilizes an analytical (closed-form) algorithm.

Note that the risk (greek) numbers produced are the mathematically defined equivalent of a derivative (instantaneous change).

You can convert the risk number to your own definition of risk by multiplying by the shift you require.

For example, for a typical definition of VANNA, (change in underlying and volatility), where one defines the change in the underlying as a single unit of change (1.0) and the change in volatility as a one percent change (0.01), simply multiply the VANNA result calculated by (1.0*0.01).

For VEGA, change in volatility of one percent (0.01), simply multiply the VEGA result by 0.01. Within option contracts THETA is negative, however the mathematically defined equivalent of THETA (instantaneous FORWARD change in time) is positive.

Internally we have negated this value for you.

To express THETA as THETA per day, simply multiply the THETA result by 1/365 or 1/252 (depending on whether you require calendar days or business days).

This function stores a portfolio of options (where the underlying does not have dividend payments) in memory and returns a key.

This allows you to price or query the portfolio for different value dates via just the portfolio key.

You can price the portfolio via the PriceOptionBook() function.

You can view the trades within the portfolio via the DisplayOptionBook() function.

The DisplayOptionBook() function allows you to sort the portfolio using any column (or combination of columns).

A column is simply the NAME of any of the parameters within this function (excluding the 'TradeKey' and 'Reload' parameters).

In addition you can create a new portfolio object from this object by grouping trades within the portfolio, for example by Currency, Units, Sector etc..., using the GroupOptionBook() function.

You simply provide the NAME of the parameters that you wish to group.

Groups can represent more than one column and thus enables you to price a portion of the portfolio (a group) using the same PriceOptionBook() function.

You can view the grouped names within the grouped portfolio via the DisplayOptionGroups() function.

You can view the trades within a group via the DisplayGRPOptionBook() function.

Furthermore you can create a new portfolio from this portfolio object by selecting a portion of the trades (via a sql-like language).

Again this portfolio can be priced via the PriceOptionBook() function.

You can also execute the WriteXLRange(), WriteXLRange2() or WriteXLRange3() and the corresponding ReadXLRange(), ReadXLRange2() or ReadXLRange3() functions in order to read and write the portfolio data to file (XML).

WriteXLRange2() is preferable as you can save each of the ranges of this function to different slots (total of 15) within the XML file.



This function creates an object and returns a string-key value to represent this created object.
The TAG value of the string-key returned (second part of the key) is : "STK_DoubleBarrier"



Note: Within Excel, the function is named - CT.STK_DoubleBarrier




High level graphic of STK_DoubleBarrier() function with parameters. Blue square node is the actual function with the parameters ordered.



Parameter Description


  1. TradeKey parameter

    User Handle used to retrieve the object
  2. Reload parameter

    When creating this object for the first time, set this parameter to a positive value. Within Excel, when recomputing a worksheet where you do not wish to recreate the object, set this parameter to zero (0).
  3. ID parameter

    Identifier of deal. Used in order to index within the portfolio.
  4. TAG parameter

    User defined Tag. The information within this column can be used within the 'CapeTools Select Sub-Portfolios' or 'CapeTools Group Sub-Portfolios' categories of functions.
  5. Ccy parameter

    Currency of the portfolio.
  6. Units parameter

    Number of option contracts you wish to trade in (positive value).
  7. Position parameter

    Whether you are long or short the option.
  8. DblBarrier parameter

    Option Types CO, PO, CI, PI
  9. Underlying parameter

    Underlying price
  10. X parameter

    Strike price of the option
  11. L parameter

    Continuous Lower barrier level
  12. U parameter

    Continuous Upper barrier level
  13. AdjBarrFreqL parameter

    Monitoring frequency that you wish the continuous lower barrier level value entered to have. (Basically will convert the barrier from continuous to discrete. If you choose 'Continuously', the barrier will still be a Continuous barrier). Valid values are : Continuously, Hourly, Daily, Weekly or Monthly.
  14. AdjBarrFreqU parameter

    Monitoring frequency that you wish the continuous upper barrier level value entered to have. (Basically will convert the barrier from continuous to discrete. If you choose 'Continuously', the barrier will still be a Continuous barrier). Valid values are : Continuously, Hourly, Daily, Weekly or Monthly.
  15. Time parameter

    Time to option maturity.
  16. Rate parameter

    For the underlying (equity, futures, FX or commodity), this should be an annualised rate (risk free rate or foreign rate). If this is an option on a FX underlying, then if the underlying is quoted as domestic/foreign then this rate will be the domestic rate. If, however, the FX underlying is quoted as foreign/domestic then this will be the foreign rate.
  17. Vol parameter

    Volatility of the underlying.
  18. Delta1 parameter

    Controls the curvature of the Lower L and upper U barriers.
  19. Delta2 parameter

    Controls the curvature of the Lower L and upper U barriers.


Extended information

Function Syntax

VB Syntax


String CTStockOptionPortfolio.STK_DoubleBarrier( _
String TradeKey, _
Long Reload, _
Variant ID, _
Variant TAG, _
Variant Ccy, _
Variant Units, _
Variant Position, _
Variant DblBarrier, _
Variant Underlying, _
Variant X, _
Variant L, _
Variant U, _
Variant AdjBarrFreqL, _
Variant AdjBarrFreqU, _
Variant Time, _
Variant Rate, _
Variant Vol, _
Variant Delta1, _
Variant Delta2)


Excel Spreadsheet Syntax


=CT.STK_DoubleBarrier(
Excel String Cell TradeKey,
Excel Numeric Cell Reload,
XLRange ID,
XLRange TAG,
XLRange Ccy,
XLRange Units,
XLRange Position,
XLRange DblBarrier,
XLRange Underlying,
XLRange X,
XLRange L,
XLRange U,
XLRange AdjBarrFreqL,
XLRange AdjBarrFreqU,
XLRange Time,
XLRange Rate,
XLRange Vol,
XLRange Delta1,
XLRange Delta2)


C++ Syntax


static std::string STK_DoubleBarrier(
std::string TradeKey,
long Reload,
CTRangeDataCPP ID,
CTRangeDataCPP TAG,
CTRangeDataCPP Ccy,
CTRangeDataCPP Units,
CTRangeDataCPP Position,
CTRangeDataCPP DblBarrier,
CTRangeDataCPP Underlying,
CTRangeDataCPP X,
CTRangeDataCPP L,
CTRangeDataCPP U,
CTRangeDataCPP AdjBarrFreqL,
CTRangeDataCPP AdjBarrFreqU,
CTRangeDataCPP Time,
CTRangeDataCPP Rate,
CTRangeDataCPP Vol,
CTRangeDataCPP Delta1,
CTRangeDataCPP Delta2);


DotNET Syntax


System.String CTStockOptionPortfolioSA.STK_DoubleBarrier(
System.String TradeKey,
System.Int32 Reload,
CTRangeData ID,
CTRangeData TAG,
CTRangeData Ccy,
CTRangeData Units,
CTRangeData Position,
CTRangeData DblBarrier,
CTRangeData Underlying,
CTRangeData X,
CTRangeData L,
CTRangeData U,
CTRangeData AdjBarrFreqL,
CTRangeData AdjBarrFreqU,
CTRangeData Time,
CTRangeData Rate,
CTRangeData Vol,
CTRangeData Delta1,
CTRangeData Delta2);

Parameter data types

ArgNameArgTypeIsKey
TradeKeyStringFALSE
ReloadLongFALSE
IDRangeFALSE
TAGRangeFALSE
CcyRangeFALSE
UnitsRangeFALSE
PositionRangeFALSE
DblBarrierRangeFALSE
UnderlyingRangeFALSE
XRangeFALSE
LRangeFALSE
URangeFALSE
AdjBarrFreqLRangeFALSE
AdjBarrFreqURangeFALSE
TimeRangeFALSE
RateRangeFALSE
VolRangeFALSE
Delta1RangeFALSE
Delta2RangeFALSE


Example Inputs

The first column represents the name of the parameters. The second column specifies whether the parameters are optional or not. Finally the last column provides some sample input data.
Function call input string-keys are always in the format : "NAME.EXTTAG.TICKER" The "EXTTAG.TICKER" part is determined from the output of other, capetools, object creation functions.


ArgNameIsOptional (Excel only)Example
TradeKeyFALSEMySTK_DoubleBarrierDeal
ReloadFALSE1
IDFALSESTK_DoubleBarrier_ID_Range (creates a range object)
TAGFALSESTK_DoubleBarrier_TAG_Range (creates a range object)
CcyFALSESTK_DoubleBarrier_Ccy_Range (creates a range object)
UnitsFALSESTK_DoubleBarrier_Units_Range (creates a range object)
PositionFALSESTK_DoubleBarrier_Position_Range (creates a range object)
DblBarrierFALSESTK_DoubleBarrier_DblBarrier_Range (creates a range object)
UnderlyingFALSESTK_DoubleBarrier_Underlying_Range (creates a range object)
XFALSESTK_DoubleBarrier_X_Range (creates a range object)
LFALSESTK_DoubleBarrier_L_Range (creates a range object)
UFALSESTK_DoubleBarrier_U_Range (creates a range object)
AdjBarrFreqLFALSESTK_DoubleBarrier_AdjBarrFreqL_Range (creates a range object)
AdjBarrFreqUFALSESTK_DoubleBarrier_AdjBarrFreqU_Range (creates a range object)
TimeFALSESTK_DoubleBarrier_Time_Range (creates a range object)
RateFALSESTK_DoubleBarrier_Rate_Range (creates a range object)
VolFALSESTK_DoubleBarrier_Vol_Range (creates a range object)
Delta1FALSESTK_DoubleBarrier_Delta1_Range (creates a range object)
Delta2FALSESTK_DoubleBarrier_Delta2_Range (creates a range object)


Example range for parameter : ID

Within Excel, a range such as this can be passed directly into the ID parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : ID



CTQL.CTRangeData STK_DoubleBarrier_ID;


string[] arrBSTK_DoubleBarrier_ID = {
"DEAL-11",
"DEAL-12",
"DEAL-13",
"DEAL-14",
"DEAL-15",
"DEAL-16",
"DEAL-17",
"DEAL-18",
"DEAL-19",
"DEAL-20",
"DEAL-21",
"DEAL-22",
"DEAL-23",
"DEAL-24",
"DEAL-25",
"DEAL-26",
"DEAL-27",
"DEAL-28",
"DEAL-29",
"DEAL-30"  //  Array Data

};

CTQL.StringVector arrSTK_DoubleBarrier_ID =
new  CTQL.StringVector(arrBSTK_DoubleBarrier_ID);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_DoubleBarrier_ID = new  CTQL.CTRangeData(arrSTK_DoubleBarrier_ID, false);


Example range for parameter : TAG

Within Excel, a range such as this can be passed directly into the TAG parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : TAG



CTQL.CTRangeData STK_DoubleBarrier_TAG;


string[] arrBSTK_DoubleBarrier_TAG = {
"TAG1",
"TAG1",
"TAG1",
"TAG1",
"TAG1",
"TAG1",
"TAG1",
"TAG1",
"TAG1",
"TAG1",
"TAG2",
"TAG2",
"TAG2",
"TAG2",
"TAG2",
"TAG2",
"TAG2",
"TAG2",
"TAG2",
"TAG2"  //  Array Data

};

CTQL.StringVector arrSTK_DoubleBarrier_TAG =
new  CTQL.StringVector(arrBSTK_DoubleBarrier_TAG);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_DoubleBarrier_TAG = new  CTQL.CTRangeData(arrSTK_DoubleBarrier_TAG, false);


Example range for parameter : Ccy

Within Excel, a range such as this can be passed directly into the Ccy parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Ccy



CTQL.CTRangeData STK_DoubleBarrier_Ccy;


string[] arrBSTK_DoubleBarrier_Ccy = {
"GBP",
"EUR",
"GBP",
"EUR",
"GBP",
"EUR",
"GBP",
"EUR",
"GBP",
"EUR",
"GBP",
"EUR",
"GBP",
"EUR",
"GBP",
"EUR",
"GBP",
"EUR",
"GBP",
"GBP"  //  Array Data

};

CTQL.StringVector arrSTK_DoubleBarrier_Ccy =
new  CTQL.StringVector(arrBSTK_DoubleBarrier_Ccy);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_DoubleBarrier_Ccy = new  CTQL.CTRangeData(arrSTK_DoubleBarrier_Ccy, false);


Example range for parameter : Units

Within Excel, a range such as this can be passed directly into the Units parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Units



CTQL.CTRangeData STK_DoubleBarrier_Units;


int[] arrBSTK_DoubleBarrier_Units = {
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1  //  Array Data

};

CTQL.IntVector arrSTK_DoubleBarrier_Units =
new  CTQL.IntVector(arrBSTK_DoubleBarrier_Units);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_DoubleBarrier_Units = new  CTQL.CTRangeData(arrSTK_DoubleBarrier_Units, false);


Example range for parameter : Position

Within Excel, a range such as this can be passed directly into the Position parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Position



CTQL.CTRangeData STK_DoubleBarrier_Position;


string[] arrBSTK_DoubleBarrier_Position = {
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG"  //  Array Data

};

CTQL.StringVector arrSTK_DoubleBarrier_Position =
new  CTQL.StringVector(arrBSTK_DoubleBarrier_Position);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_DoubleBarrier_Position = new  CTQL.CTRangeData(arrSTK_DoubleBarrier_Position, false);


Example range for parameter : DblBarrier

Within Excel, a range such as this can be passed directly into the DblBarrier parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : DblBarrier



CTQL.CTRangeData STK_DoubleBarrier_DblBarrier;


string[] arrBSTK_DoubleBarrier_DblBarrier = {
"CO",
"CO",
"CO",
"CO",
"CO",
"CO",
"CO",
"CO",
"CO",
"CO",
"CO",
"CO",
"CO",
"CO",
"CO",
"CO",
"CO",
"CO",
"CO",
"CO"  //  Array Data

};

CTQL.StringVector arrSTK_DoubleBarrier_DblBarrier =
new  CTQL.StringVector(arrBSTK_DoubleBarrier_DblBarrier);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_DoubleBarrier_DblBarrier = new  CTQL.CTRangeData(arrSTK_DoubleBarrier_DblBarrier, false);


Example range for parameter : Underlying

Within Excel, a range such as this can be passed directly into the Underlying parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Underlying



CTQL.CTRangeData STK_DoubleBarrier_Underlying;


int[] arrBSTK_DoubleBarrier_Underlying = {
98,
109,
106,
110,
106,
106,
99,
100,
107,
108,
99,
92,
106,
97,
102,
94,
110,
99,
102,
100  //  Array Data

};

CTQL.IntVector arrSTK_DoubleBarrier_Underlying =
new  CTQL.IntVector(arrBSTK_DoubleBarrier_Underlying);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_DoubleBarrier_Underlying = new  CTQL.CTRangeData(arrSTK_DoubleBarrier_Underlying, false);


Example range for parameter : X

Within Excel, a range such as this can be passed directly into the X parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : X



CTQL.CTRangeData STK_DoubleBarrier_X;


int[] arrBSTK_DoubleBarrier_X = {
97,
94,
105,
103,
101,
103,
103,
100,
99,
104,
103,
103,
91,
93,
103,
102,
105,
104,
100,
100  //  Array Data

};

CTQL.IntVector arrSTK_DoubleBarrier_X =
new  CTQL.IntVector(arrBSTK_DoubleBarrier_X);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_DoubleBarrier_X = new  CTQL.CTRangeData(arrSTK_DoubleBarrier_X, false);


Example range for parameter : L

Within Excel, a range such as this can be passed directly into the L parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : L



CTQL.CTRangeData STK_DoubleBarrier_L;


int[] arrBSTK_DoubleBarrier_L = {
85,
93,
88,
95,
84,
88,
98,
90,
96,
97,
86,
86,
91,
85,
82,
93,
90,
97,
97,
90  //  Array Data

};

CTQL.IntVector arrSTK_DoubleBarrier_L =
new  CTQL.IntVector(arrBSTK_DoubleBarrier_L);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_DoubleBarrier_L = new  CTQL.CTRangeData(arrSTK_DoubleBarrier_L, false);


Example range for parameter : U

Within Excel, a range such as this can be passed directly into the U parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : U



CTQL.CTRangeData STK_DoubleBarrier_U;


int[] arrBSTK_DoubleBarrier_U = {
100,
103,
102,
110,
104,
115,
109,
115,
102,
105,
105,
106,
99,
109,
114,
110,
105,
103,
101,
105  //  Array Data

};

CTQL.IntVector arrSTK_DoubleBarrier_U =
new  CTQL.IntVector(arrBSTK_DoubleBarrier_U);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_DoubleBarrier_U = new  CTQL.CTRangeData(arrSTK_DoubleBarrier_U, false);


Example range for parameter : AdjBarrFreqL

Within Excel, a range such as this can be passed directly into the AdjBarrFreqL parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : AdjBarrFreqL



CTQL.CTRangeData STK_DoubleBarrier_AdjBarrFreqL;


string[] arrBSTK_DoubleBarrier_AdjBarrFreqL = {
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily"  //  Array Data

};

CTQL.StringVector arrSTK_DoubleBarrier_AdjBarrFreqL =
new  CTQL.StringVector(arrBSTK_DoubleBarrier_AdjBarrFreqL);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_DoubleBarrier_AdjBarrFreqL = new  CTQL.CTRangeData(arrSTK_DoubleBarrier_AdjBarrFreqL, false);


Example range for parameter : AdjBarrFreqU

Within Excel, a range such as this can be passed directly into the AdjBarrFreqU parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : AdjBarrFreqU



CTQL.CTRangeData STK_DoubleBarrier_AdjBarrFreqU;


string[] arrBSTK_DoubleBarrier_AdjBarrFreqU = {
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily"  //  Array Data

};

CTQL.StringVector arrSTK_DoubleBarrier_AdjBarrFreqU =
new  CTQL.StringVector(arrBSTK_DoubleBarrier_AdjBarrFreqU);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_DoubleBarrier_AdjBarrFreqU = new  CTQL.CTRangeData(arrSTK_DoubleBarrier_AdjBarrFreqU, false);


Example range for parameter : Time

Within Excel, a range such as this can be passed directly into the Time parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Time



CTQL.CTRangeData STK_DoubleBarrier_Time;


int[] arrBSTK_DoubleBarrier_Time = {
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy")  //  Array Data

};

CTQL.IntVector arrSTK_DoubleBarrier_Time =
new  CTQL.IntVector(arrBSTK_DoubleBarrier_Time);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_DoubleBarrier_Time = new  CTQL.CTRangeData(arrSTK_DoubleBarrier_Time, false);


Example range for parameter : Rate

Within Excel, a range such as this can be passed directly into the Rate parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Rate



CTQL.CTRangeData STK_DoubleBarrier_Rate;


double[] arrBSTK_DoubleBarrier_Rate = {
0.0985,
0.095,
0.1025,
0.0927,
0.0926,
0.0947,
0.1018,
0.1046,
0.0928,
0.0919,
0.1025,
0.0906,
0.0952,
0.109,
0.1036,
0.0953,
0.1019,
0.0908,
0.0968,
0.1  //  Array Data

};

CTQL.DoubleVector arrSTK_DoubleBarrier_Rate =
new  CTQL.DoubleVector(arrBSTK_DoubleBarrier_Rate);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_DoubleBarrier_Rate = new  CTQL.CTRangeData(arrSTK_DoubleBarrier_Rate, false);


Example range for parameter : Vol

Within Excel, a range such as this can be passed directly into the Vol parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Vol



CTQL.CTRangeData STK_DoubleBarrier_Vol;


double[] arrBSTK_DoubleBarrier_Vol = {
0.2723,
0.2324,
0.255,
0.2253,
0.2592,
0.2455,
0.257,
0.2576,
0.2601,
0.262,
0.2626,
0.2388,
0.2356,
0.2408,
0.2728,
0.2312,
0.2518,
0.2743,
0.2384,
0.25  //  Array Data

};

CTQL.DoubleVector arrSTK_DoubleBarrier_Vol =
new  CTQL.DoubleVector(arrBSTK_DoubleBarrier_Vol);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_DoubleBarrier_Vol = new  CTQL.CTRangeData(arrSTK_DoubleBarrier_Vol, false);


Example range for parameter : Delta1

Within Excel, a range such as this can be passed directly into the Delta1 parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Delta1



CTQL.CTRangeData STK_DoubleBarrier_Delta1;


int[] arrBSTK_DoubleBarrier_Delta1 = {
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0  //  Array Data

};

CTQL.IntVector arrSTK_DoubleBarrier_Delta1 =
new  CTQL.IntVector(arrBSTK_DoubleBarrier_Delta1);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_DoubleBarrier_Delta1 = new  CTQL.CTRangeData(arrSTK_DoubleBarrier_Delta1, false);


Example range for parameter : Delta2

Within Excel, a range such as this can be passed directly into the Delta2 parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Delta2



CTQL.CTRangeData STK_DoubleBarrier_Delta2;


int[] arrBSTK_DoubleBarrier_Delta2 = {
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0  //  Array Data

};

CTQL.IntVector arrSTK_DoubleBarrier_Delta2 =
new  CTQL.IntVector(arrBSTK_DoubleBarrier_Delta2);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_DoubleBarrier_Delta2 = new  CTQL.CTRangeData(arrSTK_DoubleBarrier_Delta2, false);



Example function usage


The C# example below contains all the sub-function calls leading up to this function call. As a result, the example can contain a lot of code.

The VB.NET, J#, C++.NET, Java, Excel VBA, Visual Basic 6 (via COM) and C++ examples below contain function code stubs for the calls leading up to this function call. However, the function call for this function is displayed.
You can easily reproduce the stub functions code from the C# example.


If you are accessing this functrion via the MiniXL libraries, this function is present within the CT.QL.OptionPortfolios20 MiniXL Excel Addin.

Within our Excel Example Addin Generator, we have used the following QuantTools sub-functions in order to prepare the arguments needed to call the STK_DoubleBarrier() function. If you are executing this function via the MiniXL libraries, the module addin name, (in brackets, to the right of the sub-functions listed below), indicates the MiniXL library in which the sub-function is held. You will need to load this library into your Excel session (along with any other libraries that the sub-function call within the addin requires (ie - CT.QT.Utils20 addin in almost all cases) in order for the example to compute successfully.


The following four examples demostrate calling this function within a Microsoft .NET environment

The following four examples demostrate calling this function within a non .NET environment

The following is a sample output from executing the STK_DoubleBarrier() function call


MySTK_DoubleBarrierDeal_25.STK_DoubleBarrier.0

Copyright (c) 2003-2007 CapeTools - All Rights Reserved.