RSKTwoAssetCorrelation





http://www.QuantTools.com
CapeTools Bump Risk 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 bumps an input parameter given a bump map and displays the difference from the base value.

You can request to see the difference of any of the option greeks.

The name of the parameter that you wish to bump is simply entered into the 'BumpParam' string parameter.

The bump map can be a single value, a vector or a matrix input.



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




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



Parameter Description


  1. ValueDate parameter

    Valuation Date (typically equal to Today's date)
  2. dayCounter parameter

    For any input parameter within this function that represents a dividend rate, risk free rate, foreign rate or holding cost rate, these rates will be defined as annually compounded using the DayCounter defined within this parameter. Thus if 'actual365' is used for this 'dayCounter' parameter, then all input parameters that represent a dividend, risk free, foreign or holding cost rates will be defined as annually compounded Actual365 rates.
  3. BumpRange parameter

    A range of bump values, of which the chosen input will be bumped by. For Equity, FX type deals, you can provide a single value, vector or matrix, for interest rate type products, the bump range must be of the same shape as the market curve.
  4. BumpParam parameter

    The parameter in which will be bumped, you can only choose parameters in which the ranges normally take double (decimal) values.
  5. CallPut parameter

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

    Price of the first underlying
  7. Underlying2 parameter

    Price of the second underlying
  8. Strike1 parameter

    Strike price of underlying Price1.
  9. Strike2 parameter

    Strike price of underlying Price2.
  10. Time parameter

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

    Volatility of the underlying Price1.
  15. Vol2 parameter

    Volatility of the underlying Price2.
  16. Rho parameter

    Correlation between the two assets.
  17. Greek parameter

    For the option premium specify 'PREMIUM'. For all first derivatives, you can specify one of the following : 'dUnderlying1' (for the 'Underlying1' parameter), 'dUnderlying2' (for the 'Underlying2' parameter), 'dStrike1' (for the 'Strike1' parameter), 'dStrike2' (for the 'Strike2' parameter), 'dTime' (for the 'Time' parameter), 'db1' (for the 'b1' parameter), 'db2' (for the 'b2' parameter), 'dRate' (for the 'Rate' parameter), 'dVol1' (for the 'Vol1' parameter), 'dVol2' (for the 'Vol2' parameter), 'dRho' (for the 'Rho' parameter), For second order derivatives, you can specify combinations of the first order derivatives (i.e. - 'dUnderlying1dUnderlying1', 'dVol1dVol1', 'dUnderlying1dVol1'. )


Extended information

Function Syntax

VB Syntax


Variant CTBumpRisk.RSKTwoAssetCorrelation( _
Long ValueDate, _
DayCountEnum dayCounter, _
Variant BumpRange, _
String BumpParam, _
Variant CallPut, _
Variant Underlying1, _
Variant Underlying2, _
Variant Strike1, _
Variant Strike2, _
Variant Time, _
Variant b1, _
Variant b2, _
Variant Rate, _
Variant Vol1, _
Variant Vol2, _
Variant Rho, _
String Greek)


Excel Spreadsheet Syntax


=CT.RSKTwoAssetCorrelation(
Excel Numeric Cell ValueDate,
Excel String Cell dayCounter,
XLRange BumpRange,
Excel String Cell BumpParam,
XLRange CallPut,
XLRange Underlying1,
XLRange Underlying2,
XLRange Strike1,
XLRange Strike2,
XLRange Time,
XLRange b1,
XLRange b2,
XLRange Rate,
XLRange Vol1,
XLRange Vol2,
XLRange Rho,
Excel String Cell Greek)


C++ Syntax


static CTRangeDataCPP RSKTwoAssetCorrelation(
long ValueDate,
DayCountEnum dayCounter,
CTRangeDataCPP BumpRange,
std::string BumpParam,
CTRangeDataCPP CallPut,
CTRangeDataCPP Underlying1,
CTRangeDataCPP Underlying2,
CTRangeDataCPP Strike1,
CTRangeDataCPP Strike2,
CTRangeDataCPP Time,
CTRangeDataCPP b1,
CTRangeDataCPP b2,
CTRangeDataCPP Rate,
CTRangeDataCPP Vol1,
CTRangeDataCPP Vol2,
CTRangeDataCPP Rho,
std::string Greek);


DotNET Syntax


CTRangeData CTBumpRiskSA.RSKTwoAssetCorrelation(
System.Int32 ValueDate,
CTIEnums.DayCountEnum dayCounter,
CTRangeData BumpRange,
System.String BumpParam,
CTRangeData CallPut,
CTRangeData Underlying1,
CTRangeData Underlying2,
CTRangeData Strike1,
CTRangeData Strike2,
CTRangeData Time,
CTRangeData b1,
CTRangeData b2,
CTRangeData Rate,
CTRangeData Vol1,
CTRangeData Vol2,
CTRangeData Rho,
System.String Greek);

Parameter data types

ArgNameArgTypeIsKey
ValueDateLongFALSE
dayCounterDayCountEnumFALSE
BumpRangeRangeFALSE
BumpParamStringFALSE
CallPutRangeFALSE
Underlying1RangeFALSE
Underlying2RangeFALSE
Strike1RangeFALSE
Strike2RangeFALSE
TimeRangeFALSE
b1RangeFALSE
b2RangeFALSE
RateRangeFALSE
Vol1RangeFALSE
Vol2RangeFALSE
RhoRangeFALSE
GreekStringFALSE


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
ValueDateFALSE19/Jul/2005 (serial date type)
dayCounterFALSEACT365
BumpRangeFALSERSKTwoAssetCorrelation_BumpRange_Range (creates a range object)
BumpParamFALSEVol1
CallPutFALSERSKTwoAssetCorrelation_CallPut_Range (creates a range object)
Underlying1FALSERSKTwoAssetCorrelation_Underlying1_Range (creates a range object)
Underlying2FALSERSKTwoAssetCorrelation_Underlying2_Range (creates a range object)
Strike1FALSERSKTwoAssetCorrelation_Strike1_Range (creates a range object)
Strike2FALSERSKTwoAssetCorrelation_Strike2_Range (creates a range object)
TimeFALSERSKTwoAssetCorrelation_Time_Range (creates a range object)
b1FALSERSKTwoAssetCorrelation_b1_Range (creates a range object)
b2FALSERSKTwoAssetCorrelation_b2_Range (creates a range object)
RateFALSERSKTwoAssetCorrelation_Rate_Range (creates a range object)
Vol1FALSERSKTwoAssetCorrelation_Vol1_Range (creates a range object)
Vol2FALSERSKTwoAssetCorrelation_Vol2_Range (creates a range object)
RhoFALSERSKTwoAssetCorrelation_Rho_Range (creates a range object)
GreekFALSEPREMIUM


Example range for parameter : BumpRange

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


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

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



CTQL.CTRangeData RSKTwoAssetCorrelation_BumpRange;


double[] arrBRSKTwoAssetCorrelation_BumpRange = {
0.0193,
0.0219,
0.0209,
0.0213,
0.0185,
0.0188,
0.0188,
0.0184,
0.0195,
0.0197,
0.0217,
0.0217,
0.0188,
0.0198,
0.0202,
0.0187,
0.0197,
0.0188,
0.0195,
0.02  //  Array Data

};

CTQL.DoubleVector arrRSKTwoAssetCorrelation_BumpRange =
new  CTQL.DoubleVector(arrBRSKTwoAssetCorrelation_BumpRange);

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


string[] arrBRSKTwoAssetCorrelation_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 arrRSKTwoAssetCorrelation_CallPut =
new  CTQL.StringVector(arrBRSKTwoAssetCorrelation_CallPut);

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


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

};

CTQL.IntVector arrRSKTwoAssetCorrelation_Underlying1 =
new  CTQL.IntVector(arrBRSKTwoAssetCorrelation_Underlying1);

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


int[] arrBRSKTwoAssetCorrelation_Underlying2 = {
66,
69,
62,
69,
66,
61,
71,
70,
64,
66,
63,
63,
62,
61,
59,
64,
67,
63,
61,
65  //  Array Data

};

CTQL.IntVector arrRSKTwoAssetCorrelation_Underlying2 =
new  CTQL.IntVector(arrBRSKTwoAssetCorrelation_Underlying2);

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


int[] arrBRSKTwoAssetCorrelation_Strike1 = {
45,
50,
50,
48,
48,
47,
48,
46,
50,
49,
51,
47,
52,
53,
46,
51,
45,
50,
50,
50  //  Array Data

};

CTQL.IntVector arrRSKTwoAssetCorrelation_Strike1 =
new  CTQL.IntVector(arrBRSKTwoAssetCorrelation_Strike1);

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


int[] arrBRSKTwoAssetCorrelation_Strike2 = {
76,
64,
65,
75,
68,
76,
71,
68,
67,
66,
71,
68,
67,
72,
71,
72,
71,
73,
65,
70  //  Array Data

};

CTQL.IntVector arrRSKTwoAssetCorrelation_Strike2 =
new  CTQL.IntVector(arrBRSKTwoAssetCorrelation_Strike2);

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


int[] arrBRSKTwoAssetCorrelation_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 arrRSKTwoAssetCorrelation_Time =
new  CTQL.IntVector(arrBRSKTwoAssetCorrelation_Time);

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

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

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

// Parse the string into the Range object.
RSKTwoAssetCorrelation_b1.RangeFromStr( RSKTwoAssetCorrelation_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 RSKTwoAssetCorrelation_b2 = new CTQL.CTRangeData();

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

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

// Parse the string into the Range object.
RSKTwoAssetCorrelation_b2.RangeFromStr( RSKTwoAssetCorrelation_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 RSKTwoAssetCorrelation_Rate;


double[] arrBRSKTwoAssetCorrelation_Rate = {
0.0992,
0.0959,
0.0982,
0.1076,
0.109,
0.0998,
0.0912,
0.0994,
0.1067,
0.0924,
0.1014,
0.1096,
0.0982,
0.0973,
0.0943,
0.0936,
0.103,
0.0966,
0.0997,
0.1  //  Array Data

};

CTQL.DoubleVector arrRSKTwoAssetCorrelation_Rate =
new  CTQL.DoubleVector(arrBRSKTwoAssetCorrelation_Rate);

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


double[] arrBRSKTwoAssetCorrelation_Vol1 = {
0.184,
0.1995,
0.1824,
0.2027,
0.1824,
0.1991,
0.2092,
0.2156,
0.1938,
0.1846,
0.2026,
0.195,
0.1862,
0.1851,
0.1984,
0.1863,
0.2065,
0.192,
0.1843,
0.2  //  Array Data

};

CTQL.DoubleVector arrRSKTwoAssetCorrelation_Vol1 =
new  CTQL.DoubleVector(arrBRSKTwoAssetCorrelation_Vol1);

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


double[] arrBRSKTwoAssetCorrelation_Vol2 = {
0.2806,
0.277,
0.294,
0.2954,
0.2808,
0.2771,
0.3066,
0.2939,
0.3108,
0.3054,
0.3023,
0.3202,
0.3273,
0.2852,
0.2902,
0.2904,
0.2702,
0.3107,
0.3059,
0.3  //  Array Data

};

CTQL.DoubleVector arrRSKTwoAssetCorrelation_Vol2 =
new  CTQL.DoubleVector(arrBRSKTwoAssetCorrelation_Vol2);

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


double[] arrBRSKTwoAssetCorrelation_Rho = {
0.8194,
0.8007,
0.6839,
0.7935,
0.7654,
0.7639,
0.6791,
0.7417,
0.7074,
0.716,
0.7759,
0.7795,
0.6974,
0.7731,
0.7107,
0.6942,
0.7829,
0.7647,
0.7792,
0.75  //  Array Data

};

CTQL.DoubleVector arrRSKTwoAssetCorrelation_Rho =
new  CTQL.DoubleVector(arrBRSKTwoAssetCorrelation_Rho);

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


Example
-0.0216361
-0.0130944
-0.0112162
-0.0115004
0.0277784
-0.00901002
-0.00297034
-0.00416683
-0.00563548
-0.00147949
-0.0291971
0.0403509
0.0416769
0.0303517
-0.0219828
-0.000258405
-0.0231721
-0.00100037
-0.0169016
-0.0211273



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