SwaptionPortfolio





http://www.QuantTools.com
CapeTools Swaption Portfolio function list

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

Key TAGs | Excel Index | API Index



Creates a Swaption portfolio object.

A discounting yieldcurve object will be associated with each Swaption object once created.

A 'SwaptionKey' string value will be returned on a successful creation of the Swaption portfolio object.

This string 'Key' value can then be passed to further Swaption functions for pricing or querying.



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



Note: Within Excel, the function is named - CT.BOOK.SwaptionPortfolio




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



Parameter Description


  1. Key parameter

    Key Handle to be used for the new Portfolio 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. GroupedIndex parameter

    Key to an already constructed GroupedIndex object. This object is needed in order to extract the necessary index objects needed for pricing. CMS index objects are not supported for Swaption deals.
  4. YCKey parameter

    Key to an already constructed YieldCurve object. This curve will be used for discounting.
  5. IRVolCurve parameter

    Key to an already constructed IR VolCurve object.
  6. SwaptionRange parameter

    A 13 column Swaption range : 'SwaptionName', 'Position', 'PayRec', 'ExerciseDate', 'StartDate', 'EndDate', 'Notional', 'Coupon', 'FixBDC', 'FixDayCount', 'FixFreq', 'IndexCode' and 'Margin'. The range must contain the titles (detailed within the previous paragraph) for each column.


Extended information

Function Syntax

VB Syntax


String CTOSPortfolio.SwaptionPortfolio( _
String Key, _
Long Reload, _
String GroupedIndex, _
String YCKey, _
String IRVolCurve, _
Variant SwaptionRange)


Excel Spreadsheet Syntax


=CT.BOOK.SwaptionPortfolio(
Excel String Cell Key,
Excel Numeric Cell Reload,
Excel String Cell GroupedIndex,
Excel String Cell YCKey,
Excel String Cell IRVolCurve,
XLRange SwaptionRange)


C++ Syntax


static std::string SwaptionPortfolio(
std::string Key,
long Reload,
std::string GroupedIndex,
std::string YCKey,
std::string IRVolCurve,
CTRangeDataCPP SwaptionRange);


DotNET Syntax


System.String CTOSPortfolioSA.SwaptionPortfolio(
System.String Key,
System.Int32 Reload,
System.String GroupedIndex,
System.String YCKey,
System.String IRVolCurve,
CTRangeData SwaptionRange);

Parameter data types

ArgNameArgTypeIsKey
KeyStringFALSE
ReloadLongFALSE
GroupedIndexStringTRUE
YCKeyStringTRUE
IRVolCurveStringTRUE
SwaptionRangeRangeFALSE


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
KeyFALSEMySwaptionPortfolio
ReloadFALSE1
GroupedIndexFALSEGroupedIndexNAME.EXTTAG.TICKER (from a function call)
YCKeyFALSEYCKeyNAME.EXTTAG.TICKER (from a function call)
IRVolCurveFALSEIRVolCurveNAME.EXTTAG.TICKER (from a function call)
SwaptionRangeFALSESwaptionPortfolio_SwaptionRange_Range (creates a range object)


Example range for parameter : SwaptionRange

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

SwaptionNamePositionPayRecExerciseDateStartDateEndDateNotionalCouponFixBDCFixDayCountFixFreqIndexCodeMargin
OS-123456shortreciever19/Jul/201121/Jul/201121/Jul/2016500000005.17ModifiedfollowingACT365FSEURLIBOR3M0.0002
OS : 19-Jul-2012 / 5.31%shortreciever19/Jul/201221/Jul/201221/Jul/2017500000005.31ModifiedfollowingACT365FSEURLIBOR1M0.0002
OS : 19-Jul-2013 / 5.47%shortreciever19/Jul/201321/Jul/201321/Jul/2018500000005.47ModifiedfollowingACT365FSEURLIBOR1M0.0002
OS : 19-Jul-2014 / 5.59%shortreciever19/Jul/201421/Jul/201421/Jul/2019500000005.59ModifiedfollowingACT365FSEURLIBOR6M0.0002
OS : 19-Jul-2015 / 5.74%shortreciever19/Jul/201521/Jul/201521/Jul/2020500000005.74ModifiedfollowingACT365FSEURLIBOR6M0.0002
OS : 19-Jul-2016 / 5.92%longpayer19/Jul/201621/Jul/201621/Jul/2021100000005.92ModifiedfollowingACT365FSEURLIBOR12M0.0002
OS : 19-Jul-2017 / 6.06%longpayer19/Jul/201721/Jul/201721/Jul/2022100000006.06ModifiedfollowingACT365FSEURLIBOR12M0.0002
OS : 19-Jul-2018 / 6.23%longpayer19/Jul/201821/Jul/201821/Jul/2023100000006.23ModifiedfollowingACT365FSEURLIBOR3M0.0002
OS : 19-Jul-2019 / 6.38%longpayer19/Jul/201921/Jul/201921/Jul/2024100000006.38ModifiedfollowingACT365FSEURLIBOR3M0.0002
OS : 19-Jul-2020 / 6.51%longpayer19/Jul/202021/Jul/202021/Jul/2025100000006.51ModifiedfollowingACT365FSEURLIBOR6M0.0002
OS : 19-Jul-2021 / 6.69%longpayer19/Jul/202121/Jul/202121/Jul/2026100000006.69ModifiedfollowingACT365FSEURLIBOR6M0.0002

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



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

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

SwaptionPortfolio_SwaptionRange_builder.Append("{");
SwaptionPortfolio_SwaptionRange_builder.Append("SwaptionName	 | Position	 | PayRec	 | ExerciseDate	 | StartDate	 | EndDate	 | Notional	 | Coupon	 | FixBDC	 | FixDayCount	 | FixFreq	 | IndexCode	 | Margin ;");
SwaptionPortfolio_SwaptionRange_builder.Append("OS-123456	 | short	 | reciever	 | #19/Jul/2011#	 | #21/Jul/2011#	 | #21/Jul/2016#	 | 50000000	 | 5.17	 | Modifiedfollowing	 | ACT365F	 | S	 | EURLIBOR3M	 | 0.0002 ;");
SwaptionPortfolio_SwaptionRange_builder.Append("OS : 19-Jul-2012 / 5.31%	 | short	 | reciever	 | #19/Jul/2012#	 | #21/Jul/2012#	 | #21/Jul/2017#	 | 50000000	 | 5.31	 | Modifiedfollowing	 | ACT365F	 | S	 | EURLIBOR1M	 | 0.0002 ;");
SwaptionPortfolio_SwaptionRange_builder.Append("OS : 19-Jul-2013 / 5.47%	 | short	 | reciever	 | #19/Jul/2013#	 | #21/Jul/2013#	 | #21/Jul/2018#	 | 50000000	 | 5.47	 | Modifiedfollowing	 | ACT365F	 | S	 | EURLIBOR1M	 | 0.0002 ;");
SwaptionPortfolio_SwaptionRange_builder.Append("OS : 19-Jul-2014 / 5.59%	 | short	 | reciever	 | #19/Jul/2014#	 | #21/Jul/2014#	 | #21/Jul/2019#	 | 50000000	 | 5.59	 | Modifiedfollowing	 | ACT365F	 | S	 | EURLIBOR6M	 | 0.0002 ;");
SwaptionPortfolio_SwaptionRange_builder.Append("OS : 19-Jul-2015 / 5.74%	 | short	 | reciever	 | #19/Jul/2015#	 | #21/Jul/2015#	 | #21/Jul/2020#	 | 50000000	 | 5.74	 | Modifiedfollowing	 | ACT365F	 | S	 | EURLIBOR6M	 | 0.0002 ;");
SwaptionPortfolio_SwaptionRange_builder.Append("OS : 19-Jul-2016 / 5.92%	 | long	 | payer	 | #19/Jul/2016#	 | #21/Jul/2016#	 | #21/Jul/2021#	 | 10000000	 | 5.92	 | Modifiedfollowing	 | ACT365F	 | S	 | EURLIBOR12M	 | 0.0002 ;");
SwaptionPortfolio_SwaptionRange_builder.Append("OS : 19-Jul-2017 / 6.06%	 | long	 | payer	 | #19/Jul/2017#	 | #21/Jul/2017#	 | #21/Jul/2022#	 | 10000000	 | 6.06	 | Modifiedfollowing	 | ACT365F	 | S	 | EURLIBOR12M	 | 0.0002 ;");
SwaptionPortfolio_SwaptionRange_builder.Append("OS : 19-Jul-2018 / 6.23%	 | long	 | payer	 | #19/Jul/2018#	 | #21/Jul/2018#	 | #21/Jul/2023#	 | 10000000	 | 6.23	 | Modifiedfollowing	 | ACT365F	 | S	 | EURLIBOR3M	 | 0.0002 ;");
SwaptionPortfolio_SwaptionRange_builder.Append("OS : 19-Jul-2019 / 6.38%	 | long	 | payer	 | #19/Jul/2019#	 | #21/Jul/2019#	 | #21/Jul/2024#	 | 10000000	 | 6.38	 | Modifiedfollowing	 | ACT365F	 | S	 | EURLIBOR3M	 | 0.0002 ;");
SwaptionPortfolio_SwaptionRange_builder.Append("OS : 19-Jul-2020 / 6.51%	 | long	 | payer	 | #19/Jul/2020#	 | #21/Jul/2020#	 | #21/Jul/2025#	 | 10000000	 | 6.51	 | Modifiedfollowing	 | ACT365F	 | S	 | EURLIBOR6M	 | 0.0002 ;");
SwaptionPortfolio_SwaptionRange_builder.Append("OS : 19-Jul-2021 / 6.69%	 | long	 | payer	 | #19/Jul/2021#	 | #21/Jul/2021#	 | #21/Jul/2026#	 | 10000000	 | 6.69	 | Modifiedfollowing	 | ACT365F	 | S	 | EURLIBOR6M	 | 0.0002");
SwaptionPortfolio_SwaptionRange_builder.Append("}");

// Parse the string into the Range object.
SwaptionPortfolio_SwaptionRange.RangeFromStr( SwaptionPortfolio_SwaptionRange_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.IRPortfolio20 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 SwaptionPortfolio() 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 SwaptionPortfolio() function call


MySwaptionPortfolio_3.FBOOKOS.0

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