BK_TwoAssetCorrelation





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

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

Key TAGs | Excel Index | API Index



One asset decides if the option is in or out of the money, another asset with its own strike decides the payoff.

For a call the payoff is max(S2-X2) if S1 is greater than X1 and 0 otherwise, for a put the payoff is max(X2-S2) if S1 is less than X1 and 0 otherwise.

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 : "TwoAssetCorrelation"



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




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

    Option Types (C)all or (P)ut
  9. Underlying1 parameter

    Price of the first underlying
  10. Underlying2 parameter

    Price of the second underlying
  11. Strike1 parameter

    Strike price of underlying Price1.
  12. Strike2 parameter

    Strike price of underlying Price2.
  13. Time parameter

    Expiration date of the option.
  14. 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.
  15. 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.
  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. Vol1 parameter

    Volatility of the underlying Price1.
  18. Vol2 parameter

    Volatility of the underlying Price2.
  19. Rho parameter

    Correlation between the two assets.


Extended information

Function Syntax

VB Syntax


String CTStorage.BK_TwoAssetCorrelation( _
String TradeKey, _
Long Reload, _
Variant ID, _
Variant TAG, _
Variant Ccy, _
Variant Units, _
Variant Position, _
Variant CallPut, _
Variant Underlying1, _
Variant Underlying2, _
Variant Strike1, _
Variant Strike2, _
Variant Time, _
Variant b1, _
Variant b2, _
Variant Rate, _
Variant Vol1, _
Variant Vol2, _
Variant Rho)


Excel Spreadsheet Syntax


=CT.BK_TwoAssetCorrelation(
Excel String Cell TradeKey,
Excel Numeric Cell Reload,
XLRange ID,
XLRange TAG,
XLRange Ccy,
XLRange Units,
XLRange Position,
XLRange CallPut,
XLRange Underlying1,
XLRange Underlying2,
XLRange Strike1,
XLRange Strike2,
XLRange Time,
XLRange b1,
XLRange b2,
XLRange Rate,
XLRange Vol1,
XLRange Vol2,
XLRange Rho)


C++ Syntax


static std::string BK_TwoAssetCorrelation(
std::string TradeKey,
long Reload,
CTRangeDataCPP ID,
CTRangeDataCPP TAG,
CTRangeDataCPP Ccy,
CTRangeDataCPP Units,
CTRangeDataCPP Position,
CTRangeDataCPP CallPut,
CTRangeDataCPP Underlying1,
CTRangeDataCPP Underlying2,
CTRangeDataCPP Strike1,
CTRangeDataCPP Strike2,
CTRangeDataCPP Time,
CTRangeDataCPP b1,
CTRangeDataCPP b2,
CTRangeDataCPP Rate,
CTRangeDataCPP Vol1,
CTRangeDataCPP Vol2,
CTRangeDataCPP Rho);


DotNET Syntax


System.String CTStorageSA.BK_TwoAssetCorrelation(
System.String TradeKey,
System.Int32 Reload,
CTRangeData ID,
CTRangeData TAG,
CTRangeData Ccy,
CTRangeData Units,
CTRangeData Position,
CTRangeData CallPut,
CTRangeData Underlying1,
CTRangeData Underlying2,
CTRangeData Strike1,
CTRangeData Strike2,
CTRangeData Time,
CTRangeData b1,
CTRangeData b2,
CTRangeData Rate,
CTRangeData Vol1,
CTRangeData Vol2,
CTRangeData Rho);

Parameter data types

ArgNameArgTypeIsKey
TradeKeyStringFALSE
ReloadLongFALSE
IDRangeFALSE
TAGRangeFALSE
CcyRangeFALSE
UnitsRangeFALSE
PositionRangeFALSE
CallPutRangeFALSE
Underlying1RangeFALSE
Underlying2RangeFALSE
Strike1RangeFALSE
Strike2RangeFALSE
TimeRangeFALSE
b1RangeFALSE
b2RangeFALSE
RateRangeFALSE
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_TwoAssetCorrelationDeal
ReloadFALSE1
IDFALSEBK_TwoAssetCorrelation_ID_Range (creates a range object)
TAGFALSEBK_TwoAssetCorrelation_TAG_Range (creates a range object)
CcyFALSEBK_TwoAssetCorrelation_Ccy_Range (creates a range object)
UnitsFALSEBK_TwoAssetCorrelation_Units_Range (creates a range object)
PositionFALSEBK_TwoAssetCorrelation_Position_Range (creates a range object)
CallPutFALSEBK_TwoAssetCorrelation_CallPut_Range (creates a range object)
Underlying1FALSEBK_TwoAssetCorrelation_Underlying1_Range (creates a range object)
Underlying2FALSEBK_TwoAssetCorrelation_Underlying2_Range (creates a range object)
Strike1FALSEBK_TwoAssetCorrelation_Strike1_Range (creates a range object)
Strike2FALSEBK_TwoAssetCorrelation_Strike2_Range (creates a range object)
TimeFALSEBK_TwoAssetCorrelation_Time_Range (creates a range object)
b1FALSEBK_TwoAssetCorrelation_b1_Range (creates a range object)
b2FALSEBK_TwoAssetCorrelation_b2_Range (creates a range object)
RateFALSEBK_TwoAssetCorrelation_Rate_Range (creates a range object)
Vol1FALSEBK_TwoAssetCorrelation_Vol1_Range (creates a range object)
Vol2FALSEBK_TwoAssetCorrelation_Vol2_Range (creates a range object)
RhoFALSEBK_TwoAssetCorrelation_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_TwoAssetCorrelation_ID;


string[] arrBBK_TwoAssetCorrelation_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_TwoAssetCorrelation_ID =
new  CTQL.StringVector(arrBBK_TwoAssetCorrelation_ID);

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


string[] arrBBK_TwoAssetCorrelation_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_TwoAssetCorrelation_TAG =
new  CTQL.StringVector(arrBBK_TwoAssetCorrelation_TAG);

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


string[] arrBBK_TwoAssetCorrelation_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_TwoAssetCorrelation_Ccy =
new  CTQL.StringVector(arrBBK_TwoAssetCorrelation_Ccy);

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


int[] arrBBK_TwoAssetCorrelation_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_TwoAssetCorrelation_Units =
new  CTQL.IntVector(arrBBK_TwoAssetCorrelation_Units);

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


string[] arrBBK_TwoAssetCorrelation_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_TwoAssetCorrelation_Position =
new  CTQL.StringVector(arrBBK_TwoAssetCorrelation_Position);

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


Example range for parameter : CallPut

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


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

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



CTQL.CTRangeData BK_TwoAssetCorrelation_CallPut;


string[] arrBBK_TwoAssetCorrelation_CallPut = {
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call"  //  Array Data

};

CTQL.StringVector arrBK_TwoAssetCorrelation_CallPut =
new  CTQL.StringVector(arrBBK_TwoAssetCorrelation_CallPut);

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


Example range for parameter : Underlying1

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


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

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



CTQL.CTRangeData BK_TwoAssetCorrelation_Underlying1;


int[] arrBBK_TwoAssetCorrelation_Underlying1 = {
52,
51,
49,
56,
53,
48,
53,
54,
55,
56,
55,
54,
47,
57,
49,
55,
57,
47,
55,
52  //  Array Data

};

CTQL.IntVector arrBK_TwoAssetCorrelation_Underlying1 =
new  CTQL.IntVector(arrBBK_TwoAssetCorrelation_Underlying1);

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


Example range for parameter : Underlying2

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


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

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



CTQL.CTRangeData BK_TwoAssetCorrelation_Underlying2;


int[] arrBBK_TwoAssetCorrelation_Underlying2 = {
59,
64,
71,
62,
70,
63,
70,
64,
70,
60,
60,
60,
64,
64,
59,
67,
70,
62,
67,
65  //  Array Data

};

CTQL.IntVector arrBK_TwoAssetCorrelation_Underlying2 =
new  CTQL.IntVector(arrBBK_TwoAssetCorrelation_Underlying2);

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


Example range for parameter : Strike1

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


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

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



CTQL.CTRangeData BK_TwoAssetCorrelation_Strike1;


int[] arrBBK_TwoAssetCorrelation_Strike1 = {
51,
46,
47,
54,
47,
48,
54,
50,
54,
47,
47,
50,
50,
48,
50,
47,
55,
51,
48,
50  //  Array Data

};

CTQL.IntVector arrBK_TwoAssetCorrelation_Strike1 =
new  CTQL.IntVector(arrBBK_TwoAssetCorrelation_Strike1);

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


Example range for parameter : Strike2

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


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

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



CTQL.CTRangeData BK_TwoAssetCorrelation_Strike2;


int[] arrBBK_TwoAssetCorrelation_Strike2 = {
75,
66,
73,
76,
69,
74,
65,
73,
71,
68,
65,
77,
76,
72,
67,
74,
63,
69,
64,
70  //  Array Data

};

CTQL.IntVector arrBK_TwoAssetCorrelation_Strike2 =
new  CTQL.IntVector(arrBBK_TwoAssetCorrelation_Strike2);

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


int[] arrBBK_TwoAssetCorrelation_Time = {
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_TwoAssetCorrelation_Time =
new  CTQL.IntVector(arrBBK_TwoAssetCorrelation_Time);

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

System.Text.StringBuilder BK_TwoAssetCorrelation_b1_builder =
new System.Text.StringBuilder(100);

BK_TwoAssetCorrelation_b1_builder.Append("{");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0 ;");
BK_TwoAssetCorrelation_b1_builder.Append("0.00");
BK_TwoAssetCorrelation_b1_builder.Append("}");

// Parse the string into the Range object.
BK_TwoAssetCorrelation_b1.RangeFromStr( BK_TwoAssetCorrelation_b1_builder.ToString() );


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_TwoAssetCorrelation_b2 = new CTQL.CTRangeData();

System.Text.StringBuilder BK_TwoAssetCorrelation_b2_builder =
new System.Text.StringBuilder(100);

BK_TwoAssetCorrelation_b2_builder.Append("{");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0 ;");
BK_TwoAssetCorrelation_b2_builder.Append("0.00");
BK_TwoAssetCorrelation_b2_builder.Append("}");

// Parse the string into the Range object.
BK_TwoAssetCorrelation_b2.RangeFromStr( BK_TwoAssetCorrelation_b2_builder.ToString() );


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 BK_TwoAssetCorrelation_Rate;


double[] arrBBK_TwoAssetCorrelation_Rate = {
0.093,
0.1079,
0.1007,
0.1087,
0.1093,
0.1023,
0.0926,
0.0926,
0.1034,
0.1078,
0.0979,
0.0966,
0.0969,
0.0959,
0.0932,
0.0969,
0.1025,
0.1043,
0.0966,
0.1  //  Array Data

};

CTQL.DoubleVector arrBK_TwoAssetCorrelation_Rate =
new  CTQL.DoubleVector(arrBBK_TwoAssetCorrelation_Rate);

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


double[] arrBBK_TwoAssetCorrelation_Vol1 = {
0.1952,
0.2186,
0.1949,
0.1936,
0.212,
0.2013,
0.1972,
0.1857,
0.2088,
0.1811,
0.197,
0.2184,
0.1842,
0.2046,
0.2072,
0.1959,
0.1977,
0.2159,
0.1877,
0.2  //  Array Data

};

CTQL.DoubleVector arrBK_TwoAssetCorrelation_Vol1 =
new  CTQL.DoubleVector(arrBBK_TwoAssetCorrelation_Vol1);

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


double[] arrBBK_TwoAssetCorrelation_Vol2 = {
0.3114,
0.2877,
0.2796,
0.3272,
0.2754,
0.2744,
0.2775,
0.2948,
0.3241,
0.289,
0.3071,
0.3006,
0.278,
0.2878,
0.3234,
0.2882,
0.2803,
0.2808,
0.3004,
0.3  //  Array Data

};

CTQL.DoubleVector arrBK_TwoAssetCorrelation_Vol2 =
new  CTQL.DoubleVector(arrBBK_TwoAssetCorrelation_Vol2);

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


double[] arrBBK_TwoAssetCorrelation_Rho = {
0.7962,
0.6936,
0.8139,
0.7439,
0.7465,
0.7139,
0.727,
0.8197,
0.8111,
0.7316,
0.6768,
0.6993,
0.8226,
0.7335,
0.7496,
0.7333,
0.7513,
0.7429,
0.7722,
0.75  //  Array Data

};

CTQL.DoubleVector arrBK_TwoAssetCorrelation_Rho =
new  CTQL.DoubleVector(arrBBK_TwoAssetCorrelation_Rho);

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


MyBK_TwoAssetCorrelationDeal_13.TwoAssetCorrelation.0

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