RSKExchangeExchangeOption





http://www.QuantTools.com
CapeTools Bump Risk function list

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

Key TAGs | Excel Index | API Index



Exchange options on Exchange Options.

1=Option to exchange Q*S2 for the option to exchange S2 for S1, 2=Option to exchange the option to exchange S2 for S1 in return for Q*S2, 3=Option to exchange Q*S2 for the option to exchange S1 for S2, 4=Option to exchange the option to exchange S1 for S2 in return for Q*S2 . 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.RSKExchangeExchangeOption




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

    Integer value (1 - 4) indicating option type.
  6. Underlying1 parameter

    Price of the first underlying
  7. Underlying2 parameter

    Price of the second underlying
  8. Q parameter

    Quantity of the second underlying S2.
  9. Timet1 parameter

    Time to expiration of the original option.
  10. TimeT parameter

    Time to expiration of the underlying option, (greater than dTimet1).
  11. 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.
  12. 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.
  13. 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.
  14. Vol1 parameter

    Volatility of the underlying UnderlyingS1.
  15. Vol2 parameter

    Volatility of the underlying UnderlyingS2.
  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), 'dQ' (for the 'Q' parameter), 'dTimet1' (for the 'Timet1' parameter), 'dTimeT' (for the 'TimeT' parameter), 'dRate' (for the 'Rate' parameter), 'db1' (for the 'b1' parameter), 'db2' (for the 'b2' 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.RSKExchangeExchangeOption( _
Long ValueDate, _
DayCountEnum dayCounter, _
Variant BumpRange, _
String BumpParam, _
Variant OptionType, _
Variant Underlying1, _
Variant Underlying2, _
Variant Q, _
Variant Timet1, _
Variant TimeT, _
Variant Rate, _
Variant b1, _
Variant b2, _
Variant Vol1, _
Variant Vol2, _
Variant Rho, _
String Greek)


Excel Spreadsheet Syntax


=CT.RSKExchangeExchangeOption(
Excel Numeric Cell ValueDate,
Excel String Cell dayCounter,
XLRange BumpRange,
Excel String Cell BumpParam,
XLRange OptionType,
XLRange Underlying1,
XLRange Underlying2,
XLRange Q,
XLRange Timet1,
XLRange TimeT,
XLRange Rate,
XLRange b1,
XLRange b2,
XLRange Vol1,
XLRange Vol2,
XLRange Rho,
Excel String Cell Greek)


C++ Syntax


static CTRangeDataCPP RSKExchangeExchangeOption(
long ValueDate,
DayCountEnum dayCounter,
CTRangeDataCPP BumpRange,
std::string BumpParam,
CTRangeDataCPP OptionType,
CTRangeDataCPP Underlying1,
CTRangeDataCPP Underlying2,
CTRangeDataCPP Q,
CTRangeDataCPP Timet1,
CTRangeDataCPP TimeT,
CTRangeDataCPP Rate,
CTRangeDataCPP b1,
CTRangeDataCPP b2,
CTRangeDataCPP Vol1,
CTRangeDataCPP Vol2,
CTRangeDataCPP Rho,
std::string Greek);


DotNET Syntax


CTRangeData CTBumpRiskSA.RSKExchangeExchangeOption(
System.Int32 ValueDate,
CTIEnums.DayCountEnum dayCounter,
CTRangeData BumpRange,
System.String BumpParam,
CTRangeData OptionType,
CTRangeData Underlying1,
CTRangeData Underlying2,
CTRangeData Q,
CTRangeData Timet1,
CTRangeData TimeT,
CTRangeData Rate,
CTRangeData b1,
CTRangeData b2,
CTRangeData Vol1,
CTRangeData Vol2,
CTRangeData Rho,
System.String Greek);

Parameter data types

ArgNameArgTypeIsKey
ValueDateLongFALSE
dayCounterDayCountEnumFALSE
BumpRangeRangeFALSE
BumpParamStringFALSE
OptionTypeRangeFALSE
Underlying1RangeFALSE
Underlying2RangeFALSE
QRangeFALSE
Timet1RangeFALSE
TimeTRangeFALSE
RateRangeFALSE
b1RangeFALSE
b2RangeFALSE
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
BumpRangeFALSERSKExchangeExchangeOption_BumpRange_Range (creates a range object)
BumpParamFALSEVol1
OptionTypeFALSERSKExchangeExchangeOption_OptionType_Range (creates a range object)
Underlying1FALSERSKExchangeExchangeOption_Underlying1_Range (creates a range object)
Underlying2FALSERSKExchangeExchangeOption_Underlying2_Range (creates a range object)
QFALSERSKExchangeExchangeOption_Q_Range (creates a range object)
Timet1FALSERSKExchangeExchangeOption_Timet1_Range (creates a range object)
TimeTFALSERSKExchangeExchangeOption_TimeT_Range (creates a range object)
RateFALSERSKExchangeExchangeOption_Rate_Range (creates a range object)
b1FALSERSKExchangeExchangeOption_b1_Range (creates a range object)
b2FALSERSKExchangeExchangeOption_b2_Range (creates a range object)
Vol1FALSERSKExchangeExchangeOption_Vol1_Range (creates a range object)
Vol2FALSERSKExchangeExchangeOption_Vol2_Range (creates a range object)
RhoFALSERSKExchangeExchangeOption_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 RSKExchangeExchangeOption_BumpRange;


double[] arrBRSKExchangeExchangeOption_BumpRange = {
0.0218,
0.0211,
0.0214,
0.0211,
0.0196,
0.0199,
0.021,
0.0189,
0.0214,
0.0181,
0.021,
0.0204,
0.0217,
0.0202,
0.0188,
0.0196,
0.0195,
0.0216,
0.0198,
0.02  //  Array Data

};

CTQL.DoubleVector arrRSKExchangeExchangeOption_BumpRange =
new  CTQL.DoubleVector(arrBRSKExchangeExchangeOption_BumpRange);

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


Example range for parameter : OptionType

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


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

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



CTQL.CTRangeData RSKExchangeExchangeOption_OptionType;


int[] arrBRSKExchangeExchangeOption_OptionType = {
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2  //  Array Data

};

CTQL.IntVector arrRSKExchangeExchangeOption_OptionType =
new  CTQL.IntVector(arrBRSKExchangeExchangeOption_OptionType);

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


int[] arrBRSKExchangeExchangeOption_Underlying1 = {
111,
112,
99,
109,
110,
114,
102,
101,
96,
105,
97,
112,
103,
103,
100,
96,
115,
99,
104,
105  //  Array Data

};

CTQL.IntVector arrRSKExchangeExchangeOption_Underlying1 =
new  CTQL.IntVector(arrBRSKExchangeExchangeOption_Underlying1);

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


int[] arrBRSKExchangeExchangeOption_Underlying2 = {
96,
93,
107,
90,
93,
94,
97,
104,
100,
109,
110,
102,
102,
100,
105,
110,
102,
96,
95,
100  //  Array Data

};

CTQL.IntVector arrRSKExchangeExchangeOption_Underlying2 =
new  CTQL.IntVector(arrBRSKExchangeExchangeOption_Underlying2);

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


Example range for parameter : Q

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


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

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



CTQL.CTRangeData RSKExchangeExchangeOption_Q;


double[] arrBRSKExchangeExchangeOption_Q = {
0.0962,
0.0906,
0.1074,
0.091,
0.0968,
0.0929,
0.0929,
0.102,
0.1057,
0.1053,
0.1038,
0.1099,
0.1053,
0.1012,
0.0961,
0.0977,
0.0929,
0.0906,
0.0961,
0.1  //  Array Data

};

CTQL.DoubleVector arrRSKExchangeExchangeOption_Q =
new  CTQL.DoubleVector(arrBRSKExchangeExchangeOption_Q);

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


Example range for parameter : Timet1

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


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

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



CTQL.CTRangeData RSKExchangeExchangeOption_Timet1;


int[] arrBRSKExchangeExchangeOption_Timet1 = {
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/4/2006", "dd/mm/yyyy")  //  Array Data

};

CTQL.IntVector arrRSKExchangeExchangeOption_Timet1 =
new  CTQL.IntVector(arrBRSKExchangeExchangeOption_Timet1);

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


Example range for parameter : TimeT

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


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

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



CTQL.CTRangeData RSKExchangeExchangeOption_TimeT;


int[] arrBRSKExchangeExchangeOption_TimeT = {
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy")  //  Array Data

};

CTQL.IntVector arrRSKExchangeExchangeOption_TimeT =
new  CTQL.IntVector(arrBRSKExchangeExchangeOption_TimeT);

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


double[] arrBRSKExchangeExchangeOption_Rate = {
0.1045,
0.1075,
0.1022,
0.0951,
0.0995,
0.0963,
0.0995,
0.0978,
0.0935,
0.0931,
0.0974,
0.1039,
0.0999,
0.1041,
0.0987,
0.102,
0.1047,
0.0976,
0.1,
0.1  //  Array Data

};

CTQL.DoubleVector arrRSKExchangeExchangeOption_Rate =
new  CTQL.DoubleVector(arrBRSKExchangeExchangeOption_Rate);

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

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

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

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

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

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

// Parse the string into the Range object.
RSKExchangeExchangeOption_b2.RangeFromStr( RSKExchangeExchangeOption_b2_builder.ToString() );


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


double[] arrBRSKExchangeExchangeOption_Vol1 = {
0.2014,
0.2035,
0.1888,
0.206,
0.1922,
0.2074,
0.2179,
0.2057,
0.1822,
0.201,
0.197,
0.1988,
0.1819,
0.1948,
0.207,
0.2049,
0.1854,
0.2093,
0.2189,
0.2  //  Array Data

};

CTQL.DoubleVector arrRSKExchangeExchangeOption_Vol1 =
new  CTQL.DoubleVector(arrBRSKExchangeExchangeOption_Vol1);

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


double[] arrBRSKExchangeExchangeOption_Vol2 = {
0.2445,
0.2685,
0.2451,
0.2409,
0.261,
0.2252,
0.269,
0.2502,
0.253,
0.2525,
0.2397,
0.2426,
0.2745,
0.254,
0.2496,
0.2317,
0.2635,
0.2313,
0.2475,
0.25  //  Array Data

};

CTQL.DoubleVector arrRSKExchangeExchangeOption_Vol2 =
new  CTQL.DoubleVector(arrBRSKExchangeExchangeOption_Vol2);

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


double[] arrBRSKExchangeExchangeOption_Rho = {
0.4909,
0.5471,
0.4936,
0.5273,
0.4503,
0.4783,
0.4968,
0.4524,
0.4961,
0.5022,
0.466,
0.5469,
0.5311,
0.4667,
0.4889,
0.4542,
0.5063,
0.4752,
0.4864,
0.5  //  Array Data

};

CTQL.DoubleVector arrRSKExchangeExchangeOption_Rho =
new  CTQL.DoubleVector(arrBRSKExchangeExchangeOption_Rho);

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


Example
-0.00826494
0.0088205
-0.0490403
-0.0539568
0.00493345
-0.0454839
0.035013
0.0653696
-0.00224887
-0.0723183
-0.10501
-0.0128829
-0.0404822
-0.0380666
-0.015304
0.0120203
-0.0220333
0.0120075
-0.0677357
-0.0127803



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