IDXGBPSwap





http://www.QuantTools.com
CapeTools Indexes function list

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

Key TAGs | Excel Index | API Index



Creates a new GBP Swap Index for the computation of CMS fixing rates.

This function requires either a call to the CreateIndex() function with the correct currency code or you can use the specialised IDXGBPLibor() index object in order to define the details of the floating leg of this CMS swap index.

For the fixed side leg of this index, this function will use the following : Coupon frequency 'SemiAnnual', BusinessDayConvention BDCModifiedFollowing(), DayCounter DCActual365Fixed(), Calendar CALUKExchange() and settlement days of 0 days.

This Index can model the 'GBP-Semi-Annual Swap Rate-Reference Banks' definition as defined by ISDA.

If you require a different definition of a GBP CMS swap rate, you can execute the CreateSwapIndex() function.

There are nine algorithms that you can specify for the computation of the CMS adjustments.

Hull (which is described in 'Options, Futures, and derivatives' 5th Edition, pp600) and the other eight algorithms are based on Hagan ('Convexity Conundrums: Pricing CMS Swaps, Caps, and Floors', wilmott magazine) . HaganFullStd (integration via swaptions using Bond maths) is based on - equations 2.19a and A.3. HaganFullExact (integration via swaptions using exact yields) is based on - equations 2.19a and A.8. HaganFullPShift (integration via swaptions using Parallel shifts) is based on - equations 2.19a and A.12a. HaganFullNonPShift (integration via swaptions using Non-Parallel shifts) is based on - equations 2.19a and A.15a. HaganBlackStd (Analytical version of Hagan's formula using the Black model coupled with Bond maths) is based on - equations 3.5a and A.3. HaganBlackExact (Analytical version of Hagan's formula using the Black model coupled with exact yield calculations) is based on - equations 3.5a and A.8. HaganBlackPShift (Analytical version of Hagan's formula using the Black model coupled with Parallel shifts) is based on - equations 3.5a and A.12a. HaganBlackNonPShift (Analytical version of Hagan's formula using the Black model coupled with Non-Parallel shifts) is based on - equations 3.5a and A.15a. In terms of rate convexity adjustment, 'Hull' is the fastest but the least accurate.

Next we have 'HaganBlackStd', 'HaganBlackPShift', 'HaganBlackNonPShift' and 'HaganBlackExact'. These are quite fast also however they suffer from the fact that they do not take advantage of the volatility smile.

They use the ATM volatility only within their convexity formula.

'Hull' also uses ATM volatilities but uses a different method to handle CMS payment date adjustments.

The most accurate, but the slowest are the 'HaganFullStd', 'HaganFullPShift', 'HaganFullNonPShift' and 'HaganFullExact' algorithms.

They try to capture the volatility smile via the integration of swaptions.

We have made some optimizations to the volatility curves to detect when the 'HaganFullStd' and 'HaganFullExact' are being conducted and thus optimise volatility retrival.

Finally the value within the 'CMSAlgo' parameter determines the algorithm used for the computation of CMS caplets and floorlets.

'HaganBlackStd' will be used if 'Hull' is specified.

CMS Caplets and Floorlets are computed via CALL-PUT Parity.



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 : "IDXGBPSW"



Note: Within Excel, the function is named - CT.IDX.GBPSwap




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

    A Tag name you would like the new Swap Index code to display when querying.
  4. SwapTenor parameter

    The tenor of the swap index.
  5. IndexKey parameter

    Key to an already constructed Libor Index key. This Index contains all the information for the Float side of the swap.
  6. CMSAlgo parameter

    The CMS algorithm to apply. Possible values are 'Hull', 'HaganFullStd' (integration via swaptions using Bond maths), 'HaganFullExact' (integration via swaptions using exact yields), 'HaganFullPShift' (integration via swaptions using Parallel shifts), 'HaganFullNonPShift' (integration via swaptions using Non-Parallel shifts), 'HaganBlackStd' (Analytical version of Hagan's formula using the Black model coupled with Bond maths), 'HaganBlackExact' (Analytical version of Hagan's formula using the Black model coupled with exact yield calculations), , 'HaganBlackPShift' (Analytical version of Hagan's formula using the Black model coupled with Parallel shifts) or 'HaganBlackNonPShift' (Analytical version of Hagan's formula using the Black model coupled with Non-Parallel shifts).
  7. CMSMeanRev parameter

    If the 'CMSAlgo' parameter is set to 'HaganBlackNonPShift' or 'HaganFullNonPShift' then a positive mean reversion parameter is required.
  8. PastFixings parameter

    Optional Swap past fixings range.


Extended information

Function Syntax

VB Syntax


String CTIndexes.IDXGBPSwap( _
String Key, _
Long Reload, _
String SwapIndName, _
String SwapTenor, _
String IndexKey, _
String CMSAlgo, _
Double CMSMeanRev, _
Variant PastFixings)


Excel Spreadsheet Syntax


=CT.IDX.GBPSwap(
Excel String Cell Key,
Excel Numeric Cell Reload,
Excel String Cell SwapIndName,
Excel String Cell SwapTenor,
Excel String Cell IndexKey,
Excel String Cell CMSAlgo,
Excel Numeric Cell CMSMeanRev,
XLRange PastFixings)


C++ Syntax


static std::string IDXGBPSwap(
std::string Key,
long Reload,
std::string SwapIndName,
std::string SwapTenor,
std::string IndexKey,
std::string CMSAlgo,
double CMSMeanRev,
CTRangeDataCPP PastFixings);


DotNET Syntax


System.String CTIndexesSA.IDXGBPSwap(
System.String Key,
System.Int32 Reload,
System.String SwapIndName,
System.String SwapTenor,
System.String IndexKey,
System.String CMSAlgo,
System.Double CMSMeanRev,
CTRangeData PastFixings);

Parameter data types

ArgNameArgTypeIsKey
KeyStringFALSE
ReloadLongFALSE
SwapIndNameStringFALSE
SwapTenorStringFALSE
IndexKeyStringTRUE
CMSAlgoStringFALSE
CMSMeanRevDoubleFALSE
PastFixingsRangeFALSE


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
KeyFALSEMyGBPCMS2Y
ReloadFALSE1
SwapIndNameFALSEGBP2Y_S
SwapTenorFALSE2Y
IndexKeyFALSEIndexKeyNAME.EXTTAG.TICKER (from a function call)
CMSAlgoFALSEHaganBlackStd
CMSMeanRevTRUE0.01
PastFixingsTRUEIDXGBPSwap_PastFixings_Range (creates a range object)


Example range for parameter : PastFixings

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

21/Mar/20050.0549
22/Mar/20050.0551
23/Mar/20050.055
24/Mar/20050.055
25/Mar/20050.055
28/Mar/20050.0548
29/Mar/20050.055
30/Mar/20050.055
31/Mar/20050.0548
1/Apr/20050.0551
4/Apr/20050.055
5/Apr/20050.0551
6/Apr/20050.0549
7/Apr/20050.0549
8/Apr/20050.055
11/Apr/20050.0549
12/Apr/20050.0551
13/Apr/20050.0551
14/Apr/20050.0548
15/Apr/20050.0551
18/Apr/20050.055
19/Apr/20050.0549
20/Apr/20050.055
21/Apr/20050.055
22/Apr/20050.055
25/Apr/20050.0549
26/Apr/20050.0549
27/Apr/20050.0549
28/Apr/20050.055
29/Apr/20050.0549
2/May/20050.0551
3/May/20050.055
4/May/20050.055
5/May/20050.0552
6/May/20050.0551
9/May/20050.0549
10/May/20050.0549
11/May/20050.0552
12/May/20050.0551
13/May/20050.0552
16/May/20050.055
17/May/20050.0548
18/May/20050.055
19/May/20050.055
20/May/20050.0552
23/May/20050.0549
24/May/20050.0549
25/May/20050.055
26/May/20050.0549
27/May/20050.0551
30/May/20050.055
31/May/20050.0551
1/Jun/20050.0548
2/Jun/20050.055
3/Jun/20050.0551
6/Jun/20050.0552
7/Jun/20050.055
8/Jun/20050.055
9/Jun/20050.0551
10/Jun/20050.0551
13/Jun/20050.0548
14/Jun/20050.0548
15/Jun/20050.0549
16/Jun/20050.0548
17/Jun/20050.0551
20/Jun/20050.0548
21/Jun/20050.055
22/Jun/20050.0551
23/Jun/20050.055
24/Jun/20050.055
27/Jun/20050.055
28/Jun/20050.0552
29/Jun/20050.0548
30/Jun/20050.0549
1/Jul/20050.0549
4/Jul/20050.0549
5/Jul/20050.0548
6/Jul/20050.0552
7/Jul/20050.0549
8/Jul/20050.0549
11/Jul/20050.0549
12/Jul/20050.055
13/Jul/20050.055
14/Jul/20050.0551
15/Jul/20050.0551

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



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

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

IDXGBPSwap_PastFixings_builder.Append("{");
IDXGBPSwap_PastFixings_builder.Append("#21/Mar/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#22/Mar/2005#	 | 0.0551 ;");
IDXGBPSwap_PastFixings_builder.Append("#23/Mar/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#24/Mar/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#25/Mar/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#28/Mar/2005#	 | 0.0548 ;");
IDXGBPSwap_PastFixings_builder.Append("#29/Mar/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#30/Mar/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#31/Mar/2005#	 | 0.0548 ;");
IDXGBPSwap_PastFixings_builder.Append("#1/Apr/2005#	 | 0.0551 ;");
IDXGBPSwap_PastFixings_builder.Append("#4/Apr/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#5/Apr/2005#	 | 0.0551 ;");
IDXGBPSwap_PastFixings_builder.Append("#6/Apr/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#7/Apr/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#8/Apr/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#11/Apr/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#12/Apr/2005#	 | 0.0551 ;");
IDXGBPSwap_PastFixings_builder.Append("#13/Apr/2005#	 | 0.0551 ;");
IDXGBPSwap_PastFixings_builder.Append("#14/Apr/2005#	 | 0.0548 ;");
IDXGBPSwap_PastFixings_builder.Append("#15/Apr/2005#	 | 0.0551 ;");
IDXGBPSwap_PastFixings_builder.Append("#18/Apr/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#19/Apr/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#20/Apr/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#21/Apr/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#22/Apr/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#25/Apr/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#26/Apr/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#27/Apr/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#28/Apr/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#29/Apr/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#2/May/2005#	 | 0.0551 ;");
IDXGBPSwap_PastFixings_builder.Append("#3/May/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#4/May/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#5/May/2005#	 | 0.0552 ;");
IDXGBPSwap_PastFixings_builder.Append("#6/May/2005#	 | 0.0551 ;");
IDXGBPSwap_PastFixings_builder.Append("#9/May/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#10/May/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#11/May/2005#	 | 0.0552 ;");
IDXGBPSwap_PastFixings_builder.Append("#12/May/2005#	 | 0.0551 ;");
IDXGBPSwap_PastFixings_builder.Append("#13/May/2005#	 | 0.0552 ;");
IDXGBPSwap_PastFixings_builder.Append("#16/May/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#17/May/2005#	 | 0.0548 ;");
IDXGBPSwap_PastFixings_builder.Append("#18/May/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#19/May/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#20/May/2005#	 | 0.0552 ;");
IDXGBPSwap_PastFixings_builder.Append("#23/May/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#24/May/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#25/May/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#26/May/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#27/May/2005#	 | 0.0551 ;");
IDXGBPSwap_PastFixings_builder.Append("#30/May/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#31/May/2005#	 | 0.0551 ;");
IDXGBPSwap_PastFixings_builder.Append("#1/Jun/2005#	 | 0.0548 ;");
IDXGBPSwap_PastFixings_builder.Append("#2/Jun/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#3/Jun/2005#	 | 0.0551 ;");
IDXGBPSwap_PastFixings_builder.Append("#6/Jun/2005#	 | 0.0552 ;");
IDXGBPSwap_PastFixings_builder.Append("#7/Jun/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#8/Jun/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#9/Jun/2005#	 | 0.0551 ;");
IDXGBPSwap_PastFixings_builder.Append("#10/Jun/2005#	 | 0.0551 ;");
IDXGBPSwap_PastFixings_builder.Append("#13/Jun/2005#	 | 0.0548 ;");
IDXGBPSwap_PastFixings_builder.Append("#14/Jun/2005#	 | 0.0548 ;");
IDXGBPSwap_PastFixings_builder.Append("#15/Jun/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#16/Jun/2005#	 | 0.0548 ;");
IDXGBPSwap_PastFixings_builder.Append("#17/Jun/2005#	 | 0.0551 ;");
IDXGBPSwap_PastFixings_builder.Append("#20/Jun/2005#	 | 0.0548 ;");
IDXGBPSwap_PastFixings_builder.Append("#21/Jun/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#22/Jun/2005#	 | 0.0551 ;");
IDXGBPSwap_PastFixings_builder.Append("#23/Jun/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#24/Jun/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#27/Jun/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#28/Jun/2005#	 | 0.0552 ;");
IDXGBPSwap_PastFixings_builder.Append("#29/Jun/2005#	 | 0.0548 ;");
IDXGBPSwap_PastFixings_builder.Append("#30/Jun/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#1/Jul/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#4/Jul/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#5/Jul/2005#	 | 0.0548 ;");
IDXGBPSwap_PastFixings_builder.Append("#6/Jul/2005#	 | 0.0552 ;");
IDXGBPSwap_PastFixings_builder.Append("#7/Jul/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#8/Jul/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#11/Jul/2005#	 | 0.0549 ;");
IDXGBPSwap_PastFixings_builder.Append("#12/Jul/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#13/Jul/2005#	 | 0.055 ;");
IDXGBPSwap_PastFixings_builder.Append("#14/Jul/2005#	 | 0.0551 ;");
IDXGBPSwap_PastFixings_builder.Append("#15/Jul/2005#	 | 0.0551");
IDXGBPSwap_PastFixings_builder.Append("}");

// Parse the string into the Range object.
IDXGBPSwap_PastFixings.RangeFromStr( IDXGBPSwap_PastFixings_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 IDXGBPSwap() 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 IDXGBPSwap() function call


MyGBPCMS2Y_21.IDXGBPSW.0

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