RSKPartialFloatLB





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

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

Key TAGs | Excel Index | API Index



Call option, the right to buy the underlying security at the lowest price observed Smin, put gives the right to sell the underlying security at the highest price observed Smax.

Option time to expiry is T2, the time to the end of the lookback period is t1.

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




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

    Underlying price
  7. Smin parameter

    Minimum underlying price observed thus far
  8. Smax parameter

    Maximum underlying price observed thus far
  9. Timet1 parameter

    Time to the end of the lookback period
  10. TimeT2 parameter

    Time to expiration of the 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. Lamba parameter

    Enables fractional lookback options where the strike is fixed at some percentage above or below the actual extremum Lamba greater than or equal to 1 for calls and lamba between 0 and 1 for puts.
  15. Greek parameter

    For the option premium specify 'PREMIUM'. For all first derivatives, you can specify one of the following : 'dUnderlying' (for the 'Underlying' parameter), 'dSmin' (for the 'Smin' parameter), 'dSmax' (for the 'Smax' parameter), 'dTimet1' (for the 'Timet1' parameter), 'dTimeT2' (for the 'TimeT2' parameter), 'dRate' (for the 'Rate' parameter), 'dB' (for the 'B' parameter), 'dVol' (for the 'Vol' parameter), 'dLamba' (for the 'Lamba' 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.RSKPartialFloatLB( _
Long ValueDate, _
DayCountEnum dayCounter, _
Variant BumpRange, _
String BumpParam, _
Variant CallPut, _
Variant Underlying, _
Variant Smin, _
Variant Smax, _
Variant Timet1, _
Variant TimeT2, _
Variant Rate, _
Variant B, _
Variant Vol, _
Variant Lamba, _
String Greek)


Excel Spreadsheet Syntax


=CT.RSKPartialFloatLB(
Excel Numeric Cell ValueDate,
Excel String Cell dayCounter,
XLRange BumpRange,
Excel String Cell BumpParam,
XLRange CallPut,
XLRange Underlying,
XLRange Smin,
XLRange Smax,
XLRange Timet1,
XLRange TimeT2,
XLRange Rate,
XLRange B,
XLRange Vol,
XLRange Lamba,
Excel String Cell Greek)


C++ Syntax


static CTRangeDataCPP RSKPartialFloatLB(
long ValueDate,
DayCountEnum dayCounter,
CTRangeDataCPP BumpRange,
std::string BumpParam,
CTRangeDataCPP CallPut,
CTRangeDataCPP Underlying,
CTRangeDataCPP Smin,
CTRangeDataCPP Smax,
CTRangeDataCPP Timet1,
CTRangeDataCPP TimeT2,
CTRangeDataCPP Rate,
CTRangeDataCPP B,
CTRangeDataCPP Vol,
CTRangeDataCPP Lamba,
std::string Greek);


DotNET Syntax


CTRangeData CTBumpRiskSA.RSKPartialFloatLB(
System.Int32 ValueDate,
CTIEnums.DayCountEnum dayCounter,
CTRangeData BumpRange,
System.String BumpParam,
CTRangeData CallPut,
CTRangeData Underlying,
CTRangeData Smin,
CTRangeData Smax,
CTRangeData Timet1,
CTRangeData TimeT2,
CTRangeData Rate,
CTRangeData B,
CTRangeData Vol,
CTRangeData Lamba,
System.String Greek);

Parameter data types

ArgNameArgTypeIsKey
ValueDateLongFALSE
dayCounterDayCountEnumFALSE
BumpRangeRangeFALSE
BumpParamStringFALSE
CallPutRangeFALSE
UnderlyingRangeFALSE
SminRangeFALSE
SmaxRangeFALSE
Timet1RangeFALSE
TimeT2RangeFALSE
RateRangeFALSE
BRangeFALSE
VolRangeFALSE
LambaRangeFALSE
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
BumpRangeFALSERSKPartialFloatLB_BumpRange_Range (creates a range object)
BumpParamFALSEVol
CallPutFALSERSKPartialFloatLB_CallPut_Range (creates a range object)
UnderlyingFALSERSKPartialFloatLB_Underlying_Range (creates a range object)
SminFALSERSKPartialFloatLB_Smin_Range (creates a range object)
SmaxFALSERSKPartialFloatLB_Smax_Range (creates a range object)
Timet1FALSERSKPartialFloatLB_Timet1_Range (creates a range object)
TimeT2FALSERSKPartialFloatLB_TimeT2_Range (creates a range object)
RateFALSERSKPartialFloatLB_Rate_Range (creates a range object)
BFALSERSKPartialFloatLB_B_Range (creates a range object)
VolFALSERSKPartialFloatLB_Vol_Range (creates a range object)
LambaFALSERSKPartialFloatLB_Lamba_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 RSKPartialFloatLB_BumpRange;


double[] arrBRSKPartialFloatLB_BumpRange = {
0.021,
0.0199,
0.0204,
0.0204,
0.0214,
0.018,
0.0208,
0.0198,
0.0186,
0.0213,
0.0196,
0.0217,
0.0186,
0.0216,
0.0188,
0.0207,
0.0203,
0.0205,
0.0188,
0.02  //  Array Data

};

CTQL.DoubleVector arrRSKPartialFloatLB_BumpRange =
new  CTQL.DoubleVector(arrBRSKPartialFloatLB_BumpRange);

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


string[] arrBRSKPartialFloatLB_CallPut = {
"Put",
"Put",
"Put",
"Put",
"Put",
"Put",
"Put",
"Put",
"Put",
"Put",
"Put",
"Put",
"Put",
"Put",
"Put",
"Put",
"Put",
"Put",
"Put",
"Put"  //  Array Data

};

CTQL.StringVector arrRSKPartialFloatLB_CallPut =
new  CTQL.StringVector(arrBRSKPartialFloatLB_CallPut);

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


int[] arrBRSKPartialFloatLB_Underlying = {
82,
90,
93,
89,
88,
84,
96,
84,
90,
98,
97,
98,
82,
83,
92,
83,
97,
91,
83,
90  //  Array Data

};

CTQL.IntVector arrRSKPartialFloatLB_Underlying =
new  CTQL.IntVector(arrBRSKPartialFloatLB_Underlying);

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


Example range for parameter : Smin

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


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

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



CTQL.CTRangeData RSKPartialFloatLB_Smin;


int[] arrBRSKPartialFloatLB_Smin = {
95,
90,
92,
85,
94,
87,
87,
85,
82,
87,
90,
97,
98,
87,
82,
94,
82,
81,
98,
90  //  Array Data

};

CTQL.IntVector arrRSKPartialFloatLB_Smin =
new  CTQL.IntVector(arrBRSKPartialFloatLB_Smin);

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


Example range for parameter : Smax

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


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

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



CTQL.CTRangeData RSKPartialFloatLB_Smax;


int[] arrBRSKPartialFloatLB_Smax = {
91,
91,
93,
96,
90,
97,
93,
95,
84,
91,
94,
93,
87,
96,
97,
86,
85,
85,
95,
90  //  Array Data

};

CTQL.IntVector arrRSKPartialFloatLB_Smax =
new  CTQL.IntVector(arrBRSKPartialFloatLB_Smax);

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


int[] arrBRSKPartialFloatLB_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 arrRSKPartialFloatLB_Timet1 =
new  CTQL.IntVector(arrBRSKPartialFloatLB_Timet1);

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


Example range for parameter : TimeT2

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


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

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



CTQL.CTRangeData RSKPartialFloatLB_TimeT2;


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

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


double[] arrBRSKPartialFloatLB_Rate = {
0.0648,
0.0546,
0.061,
0.0565,
0.0549,
0.0657,
0.0622,
0.0598,
0.063,
0.0619,
0.0626,
0.0586,
0.0573,
0.0618,
0.0581,
0.0542,
0.0557,
0.0658,
0.0627,
0.06  //  Array Data

};

CTQL.DoubleVector arrRSKPartialFloatLB_Rate =
new  CTQL.DoubleVector(arrBRSKPartialFloatLB_Rate);

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

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

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

// Parse the string into the Range object.
RSKPartialFloatLB_B.RangeFromStr( RSKPartialFloatLB_B_builder.ToString() );


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


double[] arrBRSKPartialFloatLB_Vol = {
0.2107,
0.2056,
0.2028,
0.2128,
0.2154,
0.1976,
0.2184,
0.2016,
0.192,
0.2086,
0.2131,
0.184,
0.1957,
0.1953,
0.1897,
0.2139,
0.197,
0.2087,
0.1879,
0.2  //  Array Data

};

CTQL.DoubleVector arrRSKPartialFloatLB_Vol =
new  CTQL.DoubleVector(arrBRSKPartialFloatLB_Vol);

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


Example range for parameter : Lamba

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


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

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



CTQL.CTRangeData RSKPartialFloatLB_Lamba;


int[] arrBRSKPartialFloatLB_Lamba = {
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1  //  Array Data

};

CTQL.IntVector arrRSKPartialFloatLB_Lamba =
new  CTQL.IntVector(arrBRSKPartialFloatLB_Lamba);

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


Example
1.04549
1.14549
0.697219
1.01456
1.07914
1.14411
1.14685
1.07037
1.06727
1.0412
0.988877
1.04662
1.1297
0.866033
1.08346
0.678281
1.05361
1.1209
1.00111
1.08981



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