EquitySABRVolCurve





http://www.QuantTools.com
CapeTools Volatility Curves function list

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

Key TAGs | Excel Index | API Index



Creates an equity/FX/commodity SABR object to model the dynamics of the volatility curve (smile).

There are 5 market inputs to this model.

ATM vol (This is really a 'SABR' volatility column to satisfy the model, but you can input the market ATM volatility and calibrate for the other 3 parameters - see the CalibrateSABR() function), BETA (or SKEW, a value between zero and one [0,1] which determines the relationship between futures spot and at the money (ATM) volatility.

SKEW = 1 indicates that the user believes that if the market were to move up or down in an orderly fashion, the ATM volatility level would not be significantly affected (lognormal like).

Beta less than one (1) indicates that if the market were to move then ATM volatility would move in the opposite direction (normal like))), ALPHA (Is the volatility of volatility, a model feature which acknowledges that volatility obeys well known clustering in time.

It controls the wings of the smile curve, the higher the value the more wingy the smile), RHO (Correlation between rates and vols) and finally FWD (The forward price of the underlying at the option dates).

This SABR model is identical to that of the same model developed by Hagan, Kumar, Lesniewski and Woodward (2002) except that we denote the ALPHA parameter as the 'volatility of volatility' (or WING) parameter and 'ATMVol' (alpha in the case of their model) as our ‘volatility-like’ parameter.

The main SABR matrix input to this function, 'SABRMatrix' parameter, consists of option maturity rows along with five columns each representing a parameter of the SABR model (Thus 6 columns in total).

You must decorate the SABR volatility matrix with header and row information.

Row headers are option Maturity tenors from the calculation date.

The five column headers are 'ATM', 'ALPHA', 'BETA', 'RHO' and 'FWD'. You can use a combination of the SABRCalibInst() and CalibrateSABR() functions in order to calibrate the parameters (Alpha, Beta, Rho) of the SABR model.



This function creates an object and returns a string-key value to represent this created object.
The TAG value of the string-key returned (second part of the key) is : "ESABRVC"



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




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



Parameter Description


  1. Key parameter

    Key value to use as a handle for the created object
  2. Reload parameter

    When creating this object for the first time, set this parameter to a positive value. Within Excel, when re-computing a worksheet where you do not wish to recreate the object, set this parameter to zero (0).
  3. ValueDate parameter

    Key to an already created Valuation Date Object. (Via the ValueDateObj() function).
  4. SettleDays parameter

    Number of days between the Exercise date of the options and the STARTDATE of the instrument.
  5. SABRMatrix parameter

    A SABR matrix of six columns and a top row of SABR header information. 'OptionDates', 'ATMVol', 'Alpha', 'Beta', 'Rho' and 'Fwd'. The 'ATMVol' column is is really a 'SABR' volatility column value to satisfy the model, but you can input the market ATM volatility and calibrate for the other 3 parameters - see the CalibrateSABR() function
  6. DivideVolBy100 parameter

    Is the input volatility entered as a percentage value (true), or the raw volatility value (false). If entered as a percentage, the value will be divided by 100.0 internally.
  7. BusDayConv parameter

    Business Day Convention. treatment of date adjustments
  8. DayCount parameter

    DayCounter used for the calculation of option maturity in year units.
  9. Cal parameter

    Calendar to use for the adjustment of dates that lands on a holiday or weekend, if you use the EmptyCalendar() function, no adjustments will be made
  10. InterpType parameter

    Interpolation method to use when interpolating the curve for vols, - LINEAR, LOGLINEAR, CUBIC.


Extended information

Function Syntax

VB Syntax


String CTVolatiltyCurves.EquitySABRVolCurve( _
String Key, _
Long Reload, _
String ValueDate, _
Long SettleDays, _
Variant SABRMatrix, _
Boolean DivideVolBy100, _
BDCEnum BusDayConv, _
DayCountEnum DayCount, _
String Cal, _
InterpEnum InterpType)


Excel Spreadsheet Syntax


=CT.CRV.EquitySABRVolCurve(
Excel String Cell Key,
Excel Numeric Cell Reload,
Excel String Cell ValueDate,
Excel Numeric Cell SettleDays,
XLRange SABRMatrix,
Excel Boolean Value Cell DivideVolBy100,
Excel String Cell BusDayConv,
Excel String Cell DayCount,
Excel String Cell Cal,
Excel String Cell InterpType)


C++ Syntax


static std::string EquitySABRVolCurve(
std::string Key,
long Reload,
std::string ValueDate,
long SettleDays,
CTRangeDataCPP SABRMatrix,
bool DivideVolBy100,
BDCEnum BusDayConv,
DayCountEnum DayCount,
std::string Cal,
InterpEnum InterpType);


DotNET Syntax


System.String CTVolatiltyCurvesSA.EquitySABRVolCurve(
System.String Key,
System.Int32 Reload,
System.String ValueDate,
System.Int32 SettleDays,
CTRangeData SABRMatrix,
System.Boolean DivideVolBy100,
CTIEnums.BDCEnum BusDayConv,
CTIEnums.DayCountEnum DayCount,
System.String Cal,
CTIEnums.InterpEnum InterpType);

Parameter data types

ArgNameArgTypeIsKey
KeyStringFALSE
ReloadLongFALSE
ValueDateStringTRUE
SettleDaysLongFALSE
SABRMatrixRangeFALSE
DivideVolBy100BooleanFALSE
BusDayConvBDCEnumFALSE
DayCountDayCountEnumFALSE
CalStringTRUE
InterpTypeInterpEnumFALSE


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
KeyFALSEMyEquitySABRVolCurve
ReloadFALSE1
ValueDateFALSEValueDateNAME.EXTTAG.TICKER (from a function call)
SettleDaysFALSE2
SABRMatrixFALSEEquitySABRVolCurve_SABRMatrix_Range (creates a range object)
DivideVolBy100FALSEtrue
BusDayConvFALSEModifiedFollowing
DayCountFALSE30360
CalFALSECalNAME.EXTTAG.TICKER (from a function call)
InterpTypeTRUELINEAR


Example range for parameter : SABRMatrix

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

Opt\SABRATMALPHABETARHOFWD
3M20.013.80.70.25207.04
6M20.023.80.70.25215.04
9M20.023.80.70.25223.68
12M20.033.810.70.25229.31
2Y20.043.810.70.25237.12
3Y20.053.810.70.25247.11
4Y20.063.810.70.25253.04
5Y20.073.810.70.25261.81
6Y20.083.810.70.25267.77
7Y20.093.810.70.25277.48
8Y20.093.820.70.25282.77
9Y20.13.820.70.25290.6
10Y20.113.820.70.25295.62
11Y20.123.820.70.25301.61
12Y20.133.820.70.25306.96

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



CTQL.CTRangeData EquitySABRVolCurve_SABRMatrix = new CTQL.CTRangeData();

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

EquitySABRVolCurve_SABRMatrix_builder.Append("{");
EquitySABRVolCurve_SABRMatrix_builder.Append("'Opt\\SABR'	 | ATM	 | ALPHA	 | BETA	 | RHO	 | FWD ;");
EquitySABRVolCurve_SABRMatrix_builder.Append("'3M'	 | 20.01	 | 3.8	 | 0.7	 | 0.25	 | 207.04 ;");
EquitySABRVolCurve_SABRMatrix_builder.Append("'6M'	 | 20.02	 | 3.8	 | 0.7	 | 0.25	 | 215.04 ;");
EquitySABRVolCurve_SABRMatrix_builder.Append("'9M'	 | 20.02	 | 3.8	 | 0.7	 | 0.25	 | 223.68 ;");
EquitySABRVolCurve_SABRMatrix_builder.Append("'12M'	 | 20.03	 | 3.81	 | 0.7	 | 0.25	 | 229.31 ;");
EquitySABRVolCurve_SABRMatrix_builder.Append("'2Y'	 | 20.04	 | 3.81	 | 0.7	 | 0.25	 | 237.12 ;");
EquitySABRVolCurve_SABRMatrix_builder.Append("'3Y'	 | 20.05	 | 3.81	 | 0.7	 | 0.25	 | 247.11 ;");
EquitySABRVolCurve_SABRMatrix_builder.Append("'4Y'	 | 20.06	 | 3.81	 | 0.7	 | 0.25	 | 253.04 ;");
EquitySABRVolCurve_SABRMatrix_builder.Append("'5Y'	 | 20.07	 | 3.81	 | 0.7	 | 0.25	 | 261.81 ;");
EquitySABRVolCurve_SABRMatrix_builder.Append("'6Y'	 | 20.08	 | 3.81	 | 0.7	 | 0.25	 | 267.77 ;");
EquitySABRVolCurve_SABRMatrix_builder.Append("'7Y'	 | 20.09	 | 3.81	 | 0.7	 | 0.25	 | 277.48 ;");
EquitySABRVolCurve_SABRMatrix_builder.Append("'8Y'	 | 20.09	 | 3.82	 | 0.7	 | 0.25	 | 282.77 ;");
EquitySABRVolCurve_SABRMatrix_builder.Append("'9Y'	 | 20.1	 | 3.82	 | 0.7	 | 0.25	 | 290.6 ;");
EquitySABRVolCurve_SABRMatrix_builder.Append("'10Y'	 | 20.11	 | 3.82	 | 0.7	 | 0.25	 | 295.62 ;");
EquitySABRVolCurve_SABRMatrix_builder.Append("'11Y'	 | 20.12	 | 3.82	 | 0.7	 | 0.25	 | 301.61 ;");
EquitySABRVolCurve_SABRMatrix_builder.Append("'12Y'	 | 20.13	 | 3.82	 | 0.7	 | 0.25	 | 306.96");
EquitySABRVolCurve_SABRMatrix_builder.Append("}");

// Parse the string into the Range object.
EquitySABRVolCurve_SABRMatrix.RangeFromStr( EquitySABRVolCurve_SABRMatrix_builder.ToString() );



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.Curves20 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 EquitySABRVolCurve() 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.

These are the financial QuantTools sub-function calls that are used within the examples :





The objects generated by these sub-functions are inter-connected in the following way :




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 EquitySABRVolCurve() function call


MyEquitySABRVolCurve_10.ESABRVC.0

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