RSKTwoAssetBarrier





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

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

Key TAGs | Excel Index | API Index



In a two-asset barrier option, one of the underlying assets, S1, determines how much the option is in or out-of-the-money, and the other asset, S2, is linked to barrier hits.

The option is knocked in or out if asset S2 hits the Barrier H during the option period, while the payoff depends on asset S1 and the strike price X. 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.RSKTwoAssetBarrier




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

    Option Types cdi, cui, pdi, pui, cdo,cuo, pdo, puo
  6. S1 parameter

    Underlying1 price
  7. S2 parameter

    Underlying2 price
  8. X parameter

    Strike price of the option
  9. H parameter

    Continuous Barrier level
  10. AdjBarrFreq parameter

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

    Time to option maturity.
  12. 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.
  13. 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.
  14. 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.
  15. v1 parameter

    Volatility of the first underlying.
  16. v2 parameter

    Volatility of the second underlying.
  17. rho parameter

    Correlation between the two assets.
  18. Greek parameter

    For the option premium specify 'PREMIUM'. For all first derivatives, you can specify one of the following : 'dS1' (for the 'S1' parameter), 'dS2' (for the 'S2' parameter), 'dX' (for the 'X' parameter), 'dH' (for the 'H' parameter), 'dT' (for the 'T' parameter), 'dr' (for the 'r' parameter), 'db1' (for the 'b1' parameter), 'db2' (for the 'b2' parameter), 'dv1' (for the 'v1' parameter), 'dv2' (for the 'v2' parameter), 'drho' (for the 'rho' parameter), For second order derivatives, you can specify combinations of the first order derivatives (i.e. - 'dS1dS1', 'dv1dv1', 'dS1dv1'. )


Extended information

Function Syntax

VB Syntax


Variant CTBumpRisk.RSKTwoAssetBarrier( _
Long ValueDate, _
DayCountEnum dayCounter, _
Variant BumpRange, _
String BumpParam, _
Variant TypeFlag, _
Variant S1, _
Variant S2, _
Variant X, _
Variant H, _
Variant AdjBarrFreq, _
Variant T, _
Variant r, _
Variant b1, _
Variant b2, _
Variant v1, _
Variant v2, _
Variant rho, _
String Greek)


Excel Spreadsheet Syntax


=CT.RSKTwoAssetBarrier(
Excel Numeric Cell ValueDate,
Excel String Cell dayCounter,
XLRange BumpRange,
Excel String Cell BumpParam,
XLRange TypeFlag,
XLRange S1,
XLRange S2,
XLRange X,
XLRange H,
XLRange AdjBarrFreq,
XLRange T,
XLRange r,
XLRange b1,
XLRange b2,
XLRange v1,
XLRange v2,
XLRange rho,
Excel String Cell Greek)


C++ Syntax


static CTRangeDataCPP RSKTwoAssetBarrier(
long ValueDate,
DayCountEnum dayCounter,
CTRangeDataCPP BumpRange,
std::string BumpParam,
CTRangeDataCPP TypeFlag,
CTRangeDataCPP S1,
CTRangeDataCPP S2,
CTRangeDataCPP X,
CTRangeDataCPP H,
CTRangeDataCPP AdjBarrFreq,
CTRangeDataCPP T,
CTRangeDataCPP r,
CTRangeDataCPP b1,
CTRangeDataCPP b2,
CTRangeDataCPP v1,
CTRangeDataCPP v2,
CTRangeDataCPP rho,
std::string Greek);


DotNET Syntax


CTRangeData CTBumpRiskSA.RSKTwoAssetBarrier(
System.Int32 ValueDate,
CTIEnums.DayCountEnum dayCounter,
CTRangeData BumpRange,
System.String BumpParam,
CTRangeData TypeFlag,
CTRangeData S1,
CTRangeData S2,
CTRangeData X,
CTRangeData H,
CTRangeData AdjBarrFreq,
CTRangeData T,
CTRangeData r,
CTRangeData b1,
CTRangeData b2,
CTRangeData v1,
CTRangeData v2,
CTRangeData rho,
System.String Greek);

Parameter data types

ArgNameArgTypeIsKey
ValueDateLongFALSE
dayCounterDayCountEnumFALSE
BumpRangeRangeFALSE
BumpParamStringFALSE
TypeFlagRangeFALSE
S1RangeFALSE
S2RangeFALSE
XRangeFALSE
HRangeFALSE
AdjBarrFreqRangeFALSE
TRangeFALSE
rRangeFALSE
b1RangeFALSE
b2RangeFALSE
v1RangeFALSE
v2RangeFALSE
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
BumpRangeFALSERSKTwoAssetBarrier_BumpRange_Range (creates a range object)
BumpParamFALSEv1
TypeFlagFALSERSKTwoAssetBarrier_TypeFlag_Range (creates a range object)
S1FALSERSKTwoAssetBarrier_S1_Range (creates a range object)
S2FALSERSKTwoAssetBarrier_S2_Range (creates a range object)
XFALSERSKTwoAssetBarrier_X_Range (creates a range object)
HFALSERSKTwoAssetBarrier_H_Range (creates a range object)
AdjBarrFreqFALSERSKTwoAssetBarrier_AdjBarrFreq_Range (creates a range object)
TFALSERSKTwoAssetBarrier_T_Range (creates a range object)
rFALSERSKTwoAssetBarrier_r_Range (creates a range object)
b1FALSERSKTwoAssetBarrier_b1_Range (creates a range object)
b2FALSERSKTwoAssetBarrier_b2_Range (creates a range object)
v1FALSERSKTwoAssetBarrier_v1_Range (creates a range object)
v2FALSERSKTwoAssetBarrier_v2_Range (creates a range object)
rhoFALSERSKTwoAssetBarrier_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 RSKTwoAssetBarrier_BumpRange;


double[] arrBRSKTwoAssetBarrier_BumpRange = {
0.0195,
0.0192,
0.0185,
0.0206,
0.0217,
0.0214,
0.019,
0.0187,
0.0215,
0.02,
0.0219,
0.0188,
0.0205,
0.0187,
0.0194,
0.018,
0.0198,
0.0186,
0.0196,
0.02  //  Array Data

};

CTQL.DoubleVector arrRSKTwoAssetBarrier_BumpRange =
new  CTQL.DoubleVector(arrBRSKTwoAssetBarrier_BumpRange);

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


string[] arrBRSKTwoAssetBarrier_TypeFlag = {
"cdo",
"cdo",
"cdo",
"cdo",
"cdo",
"cdo",
"cdo",
"cdo",
"cdo",
"cdo",
"cdo",
"cdo",
"cdo",
"cdo",
"cdo",
"cdo",
"cdo",
"cdo",
"cdo",
"cdo"  //  Array Data

};

CTQL.StringVector arrRSKTwoAssetBarrier_TypeFlag =
new  CTQL.StringVector(arrBRSKTwoAssetBarrier_TypeFlag);

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


double[] arrBRSKTwoAssetBarrier_S1 = {
90.9606,
106.8725,
97.7194,
98.1804,
91.5424,
105.9718,
102.8873,
100.2793,
97.438,
96.7079,
90.4106,
103.5151,
95.3136,
105.3319,
102.7857,
96.6487,
90.1364,
103.1927,
107.2158,
100.0  //  Array Data

};

CTQL.DoubleVector arrRSKTwoAssetBarrier_S1 =
new  CTQL.DoubleVector(arrBRSKTwoAssetBarrier_S1);

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


double[] arrBRSKTwoAssetBarrier_S2 = {
107.8145,
100.6432,
99.6607,
93.847,
106.3211,
97.55,
96.6598,
104.6906,
93.268,
103.2766,
104.7781,
109.4422,
96.6936,
104.9578,
108.8605,
94.8172,
92.7026,
105.5294,
106.3496,
100.0  //  Array Data

};

CTQL.DoubleVector arrRSKTwoAssetBarrier_S2 =
new  CTQL.DoubleVector(arrBRSKTwoAssetBarrier_S2);

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


Example range for parameter : X

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


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

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



CTQL.CTRangeData RSKTwoAssetBarrier_X;


int[] arrBRSKTwoAssetBarrier_X = {
99,
102,
89,
103,
103,
99,
95,
97,
101,
86,
96,
98,
96,
91,
97,
90,
99,
97,
100,
95  //  Array Data

};

CTQL.IntVector arrRSKTwoAssetBarrier_X =
new  CTQL.IntVector(arrBRSKTwoAssetBarrier_X);

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


Example range for parameter : H

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


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

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



CTQL.CTRangeData RSKTwoAssetBarrier_H;


int[] arrBRSKTwoAssetBarrier_H = {
94,
81,
94,
89,
93,
95,
88,
89,
94,
93,
99,
89,
94,
82,
97,
95,
95,
94,
92,
90  //  Array Data

};

CTQL.IntVector arrRSKTwoAssetBarrier_H =
new  CTQL.IntVector(arrBRSKTwoAssetBarrier_H);

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


Example range for parameter : AdjBarrFreq

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


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

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



CTQL.CTRangeData RSKTwoAssetBarrier_AdjBarrFreq;


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

};

CTQL.StringVector arrRSKTwoAssetBarrier_AdjBarrFreq =
new  CTQL.StringVector(arrBRSKTwoAssetBarrier_AdjBarrFreq);

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


int[] arrBRSKTwoAssetBarrier_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 arrRSKTwoAssetBarrier_T =
new  CTQL.IntVector(arrBRSKTwoAssetBarrier_T);

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


double[] arrBRSKTwoAssetBarrier_r = {
0.0854,
0.0878,
0.0744,
0.0763,
0.085,
0.0788,
0.0727,
0.0759,
0.0745,
0.0847,
0.0869,
0.0855,
0.0856,
0.0803,
0.0819,
0.079,
0.077,
0.082,
0.0732,
0.08  //  Array Data

};

CTQL.DoubleVector arrRSKTwoAssetBarrier_r =
new  CTQL.DoubleVector(arrBRSKTwoAssetBarrier_r);

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

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

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

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

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

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

// Parse the string into the Range object.
RSKTwoAssetBarrier_b2.RangeFromStr( RSKTwoAssetBarrier_b2_builder.ToString() );


Example range for parameter : v1

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


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

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



CTQL.CTRangeData RSKTwoAssetBarrier_v1;


double[] arrBRSKTwoAssetBarrier_v1 = {
0.2196,
0.1919,
0.1847,
0.1852,
0.2042,
0.2128,
0.208,
0.1868,
0.1947,
0.1853,
0.188,
0.2042,
0.2006,
0.204,
0.1934,
0.2138,
0.1849,
0.1817,
0.1983,
0.2  //  Array Data

};

CTQL.DoubleVector arrRSKTwoAssetBarrier_v1 =
new  CTQL.DoubleVector(arrBRSKTwoAssetBarrier_v1);

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


Example range for parameter : v2

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


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

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



CTQL.CTRangeData RSKTwoAssetBarrier_v2;


double[] arrBRSKTwoAssetBarrier_v2 = {
0.2169,
0.1902,
0.2016,
0.1911,
0.2194,
0.1816,
0.201,
0.2029,
0.2043,
0.216,
0.1806,
0.1852,
0.1835,
0.1899,
0.2136,
0.1913,
0.2195,
0.2089,
0.1862,
0.2  //  Array Data

};

CTQL.DoubleVector arrRSKTwoAssetBarrier_v2 =
new  CTQL.DoubleVector(arrBRSKTwoAssetBarrier_v2);

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


double[] arrBRSKTwoAssetBarrier_rho = {
0.5198,
0.5162,
0.5444,
0.5264,
0.5244,
0.4667,
0.5244,
0.5165,
0.4881,
0.4984,
0.4861,
0.4855,
0.5437,
0.4688,
0.4886,
0.4621,
0.4864,
0.5485,
0.4511,
0.5  //  Array Data

};

CTQL.DoubleVector arrRSKTwoAssetBarrier_rho =
new  CTQL.DoubleVector(arrBRSKTwoAssetBarrier_rho);

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


Example
0.0832049
0.301646
0.266294
0.493199
0.387784
0.146472
0.529795
0.344664
0.27082
0.483043
0.271858
0.54259
0.250568
0.350329
0.429794
0.383454
0.444254
-0.242887
0.336284
0.400734



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