RSKComplexChooser





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

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

Key TAGs | Excel Index | API Index



Option that gives the holder the right to choose between a call option after time t1, with time to expiration Tc and strike Xc or a put option after time t1 with time to maturity Tp and strike Xp.

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.RSKComplexChooser




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

    Underlying price, curve
  6. StrikeC parameter

    Strike price of the call option.
  7. StrikeP parameter

    Strike price of the put option.
  8. Timet1 parameter

    Time at which the option choices will be decided.
  9. TimeC parameter

    Expiration date of the call option.
  10. TimeP parameter

    Expiration date of the put option.
  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. B parameter

    For the 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. Vol parameter

    Volatility of the underlying.
  14. Greek parameter

    For the option premium specify 'PREMIUM'. For all first derivatives, you can specify one of the following : 'dUnderlying' (for the 'Underlying' parameter), 'dStrikeC' (for the 'StrikeC' parameter), 'dStrikeP' (for the 'StrikeP' parameter), 'dTimet1' (for the 'Timet1' parameter), 'dTimeC' (for the 'TimeC' parameter), 'dTimeP' (for the 'TimeP' parameter), 'dRate' (for the 'Rate' parameter), 'dB' (for the 'B' parameter), 'dVol' (for the 'Vol' parameter), For second order derivatives, you can specify combinations of the first order derivatives (i.e. - 'dUnderlyingdUnderlying', 'dVoldVol', 'dUnderlyingdVol'. )


Extended information

Function Syntax

VB Syntax


Variant CTBumpRisk.RSKComplexChooser( _
Long ValueDate, _
DayCountEnum dayCounter, _
Variant BumpRange, _
String BumpParam, _
Variant Underlying, _
Variant StrikeC, _
Variant StrikeP, _
Variant Timet1, _
Variant TimeC, _
Variant TimeP, _
Variant Rate, _
Variant B, _
Variant Vol, _
String Greek)


Excel Spreadsheet Syntax


=CT.RSKComplexChooser(
Excel Numeric Cell ValueDate,
Excel String Cell dayCounter,
XLRange BumpRange,
Excel String Cell BumpParam,
XLRange Underlying,
XLRange StrikeC,
XLRange StrikeP,
XLRange Timet1,
XLRange TimeC,
XLRange TimeP,
XLRange Rate,
XLRange B,
XLRange Vol,
Excel String Cell Greek)


C++ Syntax


static CTRangeDataCPP RSKComplexChooser(
long ValueDate,
DayCountEnum dayCounter,
CTRangeDataCPP BumpRange,
std::string BumpParam,
CTRangeDataCPP Underlying,
CTRangeDataCPP StrikeC,
CTRangeDataCPP StrikeP,
CTRangeDataCPP Timet1,
CTRangeDataCPP TimeC,
CTRangeDataCPP TimeP,
CTRangeDataCPP Rate,
CTRangeDataCPP B,
CTRangeDataCPP Vol,
std::string Greek);


DotNET Syntax


CTRangeData CTBumpRiskSA.RSKComplexChooser(
System.Int32 ValueDate,
CTIEnums.DayCountEnum dayCounter,
CTRangeData BumpRange,
System.String BumpParam,
CTRangeData Underlying,
CTRangeData StrikeC,
CTRangeData StrikeP,
CTRangeData Timet1,
CTRangeData TimeC,
CTRangeData TimeP,
CTRangeData Rate,
CTRangeData B,
CTRangeData Vol,
System.String Greek);

Parameter data types

ArgNameArgTypeIsKey
ValueDateLongFALSE
dayCounterDayCountEnumFALSE
BumpRangeRangeFALSE
BumpParamStringFALSE
UnderlyingRangeFALSE
StrikeCRangeFALSE
StrikePRangeFALSE
Timet1RangeFALSE
TimeCRangeFALSE
TimePRangeFALSE
RateRangeFALSE
BRangeFALSE
VolRangeFALSE
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
BumpRangeFALSERSKComplexChooser_BumpRange_Range (creates a range object)
BumpParamFALSEVol
UnderlyingFALSERSKComplexChooser_Underlying_Range (creates a range object)
StrikeCFALSERSKComplexChooser_StrikeC_Range (creates a range object)
StrikePFALSERSKComplexChooser_StrikeP_Range (creates a range object)
Timet1FALSERSKComplexChooser_Timet1_Range (creates a range object)
TimeCFALSERSKComplexChooser_TimeC_Range (creates a range object)
TimePFALSERSKComplexChooser_TimeP_Range (creates a range object)
RateFALSERSKComplexChooser_Rate_Range (creates a range object)
BFALSERSKComplexChooser_B_Range (creates a range object)
VolFALSERSKComplexChooser_Vol_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 RSKComplexChooser_BumpRange;


double[] arrBRSKComplexChooser_BumpRange = {
0.0188,
0.0197,
0.0211,
0.0211,
0.0184,
0.0217,
0.0186,
0.0198,
0.0218,
0.0182,
0.0212,
0.0202,
0.021,
0.0202,
0.0217,
0.0201,
0.0181,
0.019,
0.0194,
0.02  //  Array Data

};

CTQL.DoubleVector arrRSKComplexChooser_BumpRange =
new  CTQL.DoubleVector(arrBRSKComplexChooser_BumpRange);

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


Example range for parameter : Underlying

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


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

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



CTQL.CTRangeData RSKComplexChooser_Underlying;


int[] arrBRSKComplexChooser_Underlying = {
46,
49,
48,
48,
52,
53,
52,
48,
52,
53,
46,
45,
54,
52,
49,
55,
49,
52,
52,
50  //  Array Data

};

CTQL.IntVector arrRSKComplexChooser_Underlying =
new  CTQL.IntVector(arrBRSKComplexChooser_Underlying);

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


Example range for parameter : StrikeC

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


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

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



CTQL.CTRangeData RSKComplexChooser_StrikeC;


int[] arrBRSKComplexChooser_StrikeC = {
60,
50,
59,
59,
60,
55,
60,
53,
53,
52,
58,
50,
59,
57,
58,
54,
51,
51,
57,
55  //  Array Data

};

CTQL.IntVector arrRSKComplexChooser_StrikeC =
new  CTQL.IntVector(arrBRSKComplexChooser_StrikeC);

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


Example range for parameter : StrikeP

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


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

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



CTQL.CTRangeData RSKComplexChooser_StrikeP;


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

};

CTQL.IntVector arrRSKComplexChooser_StrikeP =
new  CTQL.IntVector(arrBRSKComplexChooser_StrikeP);

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


int[] arrBRSKComplexChooser_Timet1 = {
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy")  //  Array Data

};

CTQL.IntVector arrRSKComplexChooser_Timet1 =
new  CTQL.IntVector(arrBRSKComplexChooser_Timet1);

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


Example range for parameter : TimeC

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


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

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



CTQL.CTRangeData RSKComplexChooser_TimeC;


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

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


Example range for parameter : TimeP

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


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

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



CTQL.CTRangeData RSKComplexChooser_TimeP;


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

};

CTQL.IntVector arrRSKComplexChooser_TimeP =
new  CTQL.IntVector(arrBRSKComplexChooser_TimeP);

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


double[] arrBRSKComplexChooser_Rate = {
0.1016,
0.0951,
0.0938,
0.1041,
0.1029,
0.0914,
0.1099,
0.1057,
0.093,
0.1015,
0.1035,
0.0987,
0.0982,
0.0976,
0.1039,
0.0957,
0.0972,
0.0957,
0.11,
0.1  //  Array Data

};

CTQL.DoubleVector arrRSKComplexChooser_Rate =
new  CTQL.DoubleVector(arrBRSKComplexChooser_Rate);

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


Example range for parameter : B

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


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

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



CTQL.CTRangeData RSKComplexChooser_B;


double[] arrBRSKComplexChooser_B = {
0.0528,
0.0452,
0.0532,
0.0529,
0.0546,
0.0517,
0.051,
0.0505,
0.0517,
0.0537,
0.0474,
0.0466,
0.0496,
0.0531,
0.0525,
0.0543,
0.0505,
0.0515,
0.0469,
0.05  //  Array Data

};

CTQL.DoubleVector arrRSKComplexChooser_B =
new  CTQL.DoubleVector(arrBRSKComplexChooser_B);

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


Example range for parameter : Vol

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


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

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



CTQL.CTRangeData RSKComplexChooser_Vol;


double[] arrBRSKComplexChooser_Vol = {
0.3515,
0.3688,
0.3161,
0.3844,
0.3744,
0.323,
0.3325,
0.3658,
0.3557,
0.3398,
0.3473,
0.3535,
0.3843,
0.3669,
0.3641,
0.3759,
0.3264,
0.3206,
0.3414,
0.35  //  Array Data

};

CTQL.DoubleVector arrRSKComplexChooser_Vol =
new  CTQL.DoubleVector(arrBRSKComplexChooser_Vol);

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


Example
0.398764
0.412391
0.499768
0.421595
0.433095
0.412096
0.41333
0.478049
0.501328
0.440171
0.449578
0.489433
0.406442
0.377348
0.527272
0.444048
0.454993
0.526641
0.399884
0.464525



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