BK_TwoAssetCashOrNothing





http://www.QuantTools.com
CapeTools Storage function list

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

Key TAGs | Excel Index | API Index



Four types of two-asset cash-or-nothing options exist : A two-asset cash-or-nothing call pays out a fixed cash amount K if asset one, S1 is above the strike X1 and asset two, S2, is above strike X2 at expiration (TypeFlag=1).

A two-asset cash-or-nothing put pays out a fixed cash amount if asset one, S1, is below the strike X1 and asset two, S2 is below strike X2 at expiration (TypeFlag=2).

A two-asset cash-or-nothing up-down pays out a fixed cash amount if asset one S1, is above the strike X1 and asset two, S2, is below the strike X2 at expiration (TypeFlag=3).

Finally a two-asset cash-or-nothing down-up pays out a fixed cash amount if asset one, s1, is below the strike x1 and asset two, s2, is above strike X2 at expiration (TypeFlag=4).

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 equity, commodities, futures or FX options 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 : "TwoAssetCashOrNothing"



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




High level graphic of BK_TwoAssetCashOrNothing() 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. TypeFlag parameter

    Integer value (1 - 4) indicating option type.
  9. S1 parameter

    Price of the first underlying
  10. S2 parameter

    Price of the second underlying
  11. X1 parameter

    Strike price of the first underlying.
  12. X2 parameter

    Strike price of the second underlying.
  13. K parameter

    Cash amount to be paid out.
  14. T parameter

    Time to option maturity.
  15. r 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.
  16. b1 parameter

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

    For the second underlying (equity, futures, FX or commodity), this should be an annualised rate (dividend rate, risk free rate, foreign rate or holding cost rate respectively). If this is an option on a FX underlying, then if the underlying is quoted as domestic/foreign then this rate will be the foreign rate. If, however, the FX underlying is quoted as foreign/domestic then this will be the domestic rate.
  18. Vol1 parameter

    Volatility of the first underlying.
  19. Vol2 parameter

    Volatility of the second underlying.
  20. Rho parameter

    Correlation between the two assets.


Extended information

Function Syntax

VB Syntax


String CTStorage.BK_TwoAssetCashOrNothing( _
String TradeKey, _
Long Reload, _
Variant ID, _
Variant TAG, _
Variant Ccy, _
Variant Units, _
Variant Position, _
Variant TypeFlag, _
Variant S1, _
Variant S2, _
Variant X1, _
Variant X2, _
Variant K, _
Variant T, _
Variant r, _
Variant b1, _
Variant b2, _
Variant Vol1, _
Variant Vol2, _
Variant Rho)


Excel Spreadsheet Syntax


=CT.BK_TwoAssetCashOrNothing(
Excel String Cell TradeKey,
Excel Numeric Cell Reload,
XLRange ID,
XLRange TAG,
XLRange Ccy,
XLRange Units,
XLRange Position,
XLRange TypeFlag,
XLRange S1,
XLRange S2,
XLRange X1,
XLRange X2,
XLRange K,
XLRange T,
XLRange r,
XLRange b1,
XLRange b2,
XLRange Vol1,
XLRange Vol2,
XLRange Rho)


C++ Syntax


static std::string BK_TwoAssetCashOrNothing(
std::string TradeKey,
long Reload,
CTRangeDataCPP ID,
CTRangeDataCPP TAG,
CTRangeDataCPP Ccy,
CTRangeDataCPP Units,
CTRangeDataCPP Position,
CTRangeDataCPP TypeFlag,
CTRangeDataCPP S1,
CTRangeDataCPP S2,
CTRangeDataCPP X1,
CTRangeDataCPP X2,
CTRangeDataCPP K,
CTRangeDataCPP T,
CTRangeDataCPP r,
CTRangeDataCPP b1,
CTRangeDataCPP b2,
CTRangeDataCPP Vol1,
CTRangeDataCPP Vol2,
CTRangeDataCPP Rho);


DotNET Syntax


System.String CTStorageSA.BK_TwoAssetCashOrNothing(
System.String TradeKey,
System.Int32 Reload,
CTRangeData ID,
CTRangeData TAG,
CTRangeData Ccy,
CTRangeData Units,
CTRangeData Position,
CTRangeData TypeFlag,
CTRangeData S1,
CTRangeData S2,
CTRangeData X1,
CTRangeData X2,
CTRangeData K,
CTRangeData T,
CTRangeData r,
CTRangeData b1,
CTRangeData b2,
CTRangeData Vol1,
CTRangeData Vol2,
CTRangeData Rho);

Parameter data types

ArgNameArgTypeIsKey
TradeKeyStringFALSE
ReloadLongFALSE
IDRangeFALSE
TAGRangeFALSE
CcyRangeFALSE
UnitsRangeFALSE
PositionRangeFALSE
TypeFlagRangeFALSE
S1RangeFALSE
S2RangeFALSE
X1RangeFALSE
X2RangeFALSE
KRangeFALSE
TRangeFALSE
rRangeFALSE
b1RangeFALSE
b2RangeFALSE
Vol1RangeFALSE
Vol2RangeFALSE
RhoRangeFALSE


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
TradeKeyFALSEMyBK_TwoAssetCashOrNothingDeal
ReloadFALSE1
IDFALSEBK_TwoAssetCashOrNothing_ID_Range (creates a range object)
TAGFALSEBK_TwoAssetCashOrNothing_TAG_Range (creates a range object)
CcyFALSEBK_TwoAssetCashOrNothing_Ccy_Range (creates a range object)
UnitsFALSEBK_TwoAssetCashOrNothing_Units_Range (creates a range object)
PositionFALSEBK_TwoAssetCashOrNothing_Position_Range (creates a range object)
TypeFlagFALSEBK_TwoAssetCashOrNothing_TypeFlag_Range (creates a range object)
S1FALSEBK_TwoAssetCashOrNothing_S1_Range (creates a range object)
S2FALSEBK_TwoAssetCashOrNothing_S2_Range (creates a range object)
X1FALSEBK_TwoAssetCashOrNothing_X1_Range (creates a range object)
X2FALSEBK_TwoAssetCashOrNothing_X2_Range (creates a range object)
KFALSEBK_TwoAssetCashOrNothing_K_Range (creates a range object)
TFALSEBK_TwoAssetCashOrNothing_T_Range (creates a range object)
rFALSEBK_TwoAssetCashOrNothing_r_Range (creates a range object)
b1FALSEBK_TwoAssetCashOrNothing_b1_Range (creates a range object)
b2FALSEBK_TwoAssetCashOrNothing_b2_Range (creates a range object)
Vol1FALSEBK_TwoAssetCashOrNothing_Vol1_Range (creates a range object)
Vol2FALSEBK_TwoAssetCashOrNothing_Vol2_Range (creates a range object)
RhoFALSEBK_TwoAssetCashOrNothing_Rho_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 BK_TwoAssetCashOrNothing_ID;


string[] arrBBK_TwoAssetCashOrNothing_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 arrBK_TwoAssetCashOrNothing_ID =
new  CTQL.StringVector(arrBBK_TwoAssetCashOrNothing_ID);

// Second parameter determines whether the array is a column array (false) or a row array (true)
BK_TwoAssetCashOrNothing_ID = new  CTQL.CTRangeData(arrBK_TwoAssetCashOrNothing_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 BK_TwoAssetCashOrNothing_TAG;


string[] arrBBK_TwoAssetCashOrNothing_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 arrBK_TwoAssetCashOrNothing_TAG =
new  CTQL.StringVector(arrBBK_TwoAssetCashOrNothing_TAG);

// Second parameter determines whether the array is a column array (false) or a row array (true)
BK_TwoAssetCashOrNothing_TAG = new  CTQL.CTRangeData(arrBK_TwoAssetCashOrNothing_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 BK_TwoAssetCashOrNothing_Ccy;


string[] arrBBK_TwoAssetCashOrNothing_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 arrBK_TwoAssetCashOrNothing_Ccy =
new  CTQL.StringVector(arrBBK_TwoAssetCashOrNothing_Ccy);

// Second parameter determines whether the array is a column array (false) or a row array (true)
BK_TwoAssetCashOrNothing_Ccy = new  CTQL.CTRangeData(arrBK_TwoAssetCashOrNothing_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 BK_TwoAssetCashOrNothing_Units;


int[] arrBBK_TwoAssetCashOrNothing_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 arrBK_TwoAssetCashOrNothing_Units =
new  CTQL.IntVector(arrBBK_TwoAssetCashOrNothing_Units);

// Second parameter determines whether the array is a column array (false) or a row array (true)
BK_TwoAssetCashOrNothing_Units = new  CTQL.CTRangeData(arrBK_TwoAssetCashOrNothing_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 BK_TwoAssetCashOrNothing_Position;


string[] arrBBK_TwoAssetCashOrNothing_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 arrBK_TwoAssetCashOrNothing_Position =
new  CTQL.StringVector(arrBBK_TwoAssetCashOrNothing_Position);

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


Example range for parameter : TypeFlag

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


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

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



CTQL.CTRangeData BK_TwoAssetCashOrNothing_TypeFlag;


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

};

CTQL.IntVector arrBK_TwoAssetCashOrNothing_TypeFlag =
new  CTQL.IntVector(arrBBK_TwoAssetCashOrNothing_TypeFlag);

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


Example range for parameter : S1

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


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

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



CTQL.CTRangeData BK_TwoAssetCashOrNothing_S1;


int[] arrBBK_TwoAssetCashOrNothing_S1 = {
98,
105,
98,
100,
104,
100,
95,
94,
100,
106,
96,
93,
96,
99,
99,
105,
104,
109,
92,
100  //  Array Data

};

CTQL.IntVector arrBK_TwoAssetCashOrNothing_S1 =
new  CTQL.IntVector(arrBBK_TwoAssetCashOrNothing_S1);

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


Example range for parameter : S2

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


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

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



CTQL.CTRangeData BK_TwoAssetCashOrNothing_S2;


int[] arrBBK_TwoAssetCashOrNothing_S2 = {
107,
100,
104,
106,
107,
94,
104,
106,
90,
94,
94,
104,
93,
107,
104,
95,
102,
97,
105,
100  //  Array Data

};

CTQL.IntVector arrBK_TwoAssetCashOrNothing_S2 =
new  CTQL.IntVector(arrBBK_TwoAssetCashOrNothing_S2);

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


Example range for parameter : X1

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


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

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



CTQL.CTRangeData BK_TwoAssetCashOrNothing_X1;


int[] arrBBK_TwoAssetCashOrNothing_X1 = {
103,
108,
106,
116,
121,
101,
103,
112,
108,
102,
105,
116,
118,
101,
113,
107,
103,
108,
104,
110  //  Array Data

};

CTQL.IntVector arrBK_TwoAssetCashOrNothing_X1 =
new  CTQL.IntVector(arrBBK_TwoAssetCashOrNothing_X1);

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


Example range for parameter : X2

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


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

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



CTQL.CTRangeData BK_TwoAssetCashOrNothing_X2;


int[] arrBBK_TwoAssetCashOrNothing_X2 = {
84,
97,
93,
86,
92,
84,
92,
92,
88,
93,
88,
84,
83,
81,
87,
94,
89,
97,
82,
90  //  Array Data

};

CTQL.IntVector arrBK_TwoAssetCashOrNothing_X2 =
new  CTQL.IntVector(arrBBK_TwoAssetCashOrNothing_X2);

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


Example range for parameter : K

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


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

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



CTQL.CTRangeData BK_TwoAssetCashOrNothing_K;


int[] arrBBK_TwoAssetCashOrNothing_K = {
9,
11,
9,
10,
11,
11,
10,
10,
10,
9,
10,
10,
10,
11,
10,
10,
9,
9,
9,
10  //  Array Data

};

CTQL.IntVector arrBK_TwoAssetCashOrNothing_K =
new  CTQL.IntVector(arrBBK_TwoAssetCashOrNothing_K);

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


Example range for parameter : T

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


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

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



CTQL.CTRangeData BK_TwoAssetCashOrNothing_T;


int[] arrBBK_TwoAssetCashOrNothing_T = {
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy")  //  Array Data

};

CTQL.IntVector arrBK_TwoAssetCashOrNothing_T =
new  CTQL.IntVector(arrBBK_TwoAssetCashOrNothing_T);

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


Example range for parameter : r

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


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

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



CTQL.CTRangeData BK_TwoAssetCashOrNothing_r;


double[] arrBBK_TwoAssetCashOrNothing_r = {
0.0948,
0.0985,
0.0952,
0.1055,
0.1022,
0.1027,
0.1077,
0.097,
0.1052,
0.1058,
0.1077,
0.0945,
0.1048,
0.0955,
0.0977,
0.0919,
0.0956,
0.0997,
0.1005,
0.10  //  Array Data

};

CTQL.DoubleVector arrBK_TwoAssetCashOrNothing_r =
new  CTQL.DoubleVector(arrBBK_TwoAssetCashOrNothing_r);

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


Example range for parameter : b1

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


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

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



CTQL.CTRangeData BK_TwoAssetCashOrNothing_b1;


double[] arrBBK_TwoAssetCashOrNothing_b1 = {
0.0526,
0.0527,
0.0511,
0.0488,
0.0486,
0.0451,
0.0543,
0.0503,
0.0532,
0.0461,
0.0495,
0.0528,
0.0543,
0.0499,
0.0496,
0.0504,
0.0497,
0.0511,
0.0463,
0.05  //  Array Data

};

CTQL.DoubleVector arrBK_TwoAssetCashOrNothing_b1 =
new  CTQL.DoubleVector(arrBBK_TwoAssetCashOrNothing_b1);

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


Example range for parameter : b2

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


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

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



CTQL.CTRangeData BK_TwoAssetCashOrNothing_b2;


double[] arrBBK_TwoAssetCashOrNothing_b2 = {
0.0616,
0.063,
0.0553,
0.0613,
0.058,
0.0622,
0.0597,
0.0572,
0.0576,
0.056,
0.0551,
0.0594,
0.0647,
0.0565,
0.063,
0.0582,
0.0641,
0.0622,
0.0618,
0.06  //  Array Data

};

CTQL.DoubleVector arrBK_TwoAssetCashOrNothing_b2 =
new  CTQL.DoubleVector(arrBBK_TwoAssetCashOrNothing_b2);

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


Example range for parameter : Vol1

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


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

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



CTQL.CTRangeData BK_TwoAssetCashOrNothing_Vol1;


double[] arrBBK_TwoAssetCashOrNothing_Vol1 = {
0.2144,
0.1936,
0.1843,
0.2044,
0.1948,
0.1891,
0.1977,
0.2144,
0.1844,
0.2119,
0.2039,
0.1824,
0.2105,
0.1931,
0.2116,
0.1948,
0.1967,
0.2144,
0.219,
0.20  //  Array Data

};

CTQL.DoubleVector arrBK_TwoAssetCashOrNothing_Vol1 =
new  CTQL.DoubleVector(arrBBK_TwoAssetCashOrNothing_Vol1);

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


Example range for parameter : Vol2

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


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

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



CTQL.CTRangeData BK_TwoAssetCashOrNothing_Vol2;


double[] arrBBK_TwoAssetCashOrNothing_Vol2 = {
0.2543,
0.2485,
0.2551,
0.2274,
0.2558,
0.2687,
0.2325,
0.2435,
0.2749,
0.2718,
0.2552,
0.242,
0.2424,
0.2428,
0.2337,
0.2443,
0.2347,
0.2312,
0.235,
0.25  //  Array Data

};

CTQL.DoubleVector arrBK_TwoAssetCashOrNothing_Vol2 =
new  CTQL.DoubleVector(arrBBK_TwoAssetCashOrNothing_Vol2);

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


Example range for parameter : Rho

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


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

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



CTQL.CTRangeData BK_TwoAssetCashOrNothing_Rho;


double[] arrBBK_TwoAssetCashOrNothing_Rho = {
0.5201,
0.5389,
0.4613,
0.4513,
0.5289,
0.4969,
0.4587,
0.4694,
0.4681,
0.5237,
0.4707,
0.4818,
0.5109,
0.4804,
0.4697,
0.5024,
0.5215,
0.4563,
0.5445,
0.5  //  Array Data

};

CTQL.DoubleVector arrBK_TwoAssetCashOrNothing_Rho =
new  CTQL.DoubleVector(arrBBK_TwoAssetCashOrNothing_Rho);

// Second parameter determines whether the array is a column array (false) or a row array (true)
BK_TwoAssetCashOrNothing_Rho = new  CTQL.CTRangeData(arrBK_TwoAssetCashOrNothing_Rho, 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 BK_TwoAssetCashOrNothing() 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 BK_TwoAssetCashOrNothing() function call


MyBK_TwoAssetCashOrNothingDeal_31.TwoAssetCashOrNothing.0

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