FloatLegPortfolio





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

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

Key TAGs | Excel Index | API Index



Creates a floating rate leg portfolio object (No quanto legs at this time).

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

A 'SwapKey' string value will be returned on a successful creation of the floating rate leg portfolio object.

This string 'Key' value can then be passed to further swap 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 : "FBOOKFLT"



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




High level graphic of FloatLegPortfolio() 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.
  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. Needed for CMS type deals.
  6. FLTRange parameter

    A 9 column leg range : 'FLTName', 'PayRec', 'StartDate', 'EndDate', 'Notional', 'IndexCode', 'InArrears', 'Margin', 'CMSRho'. The range must contain the titles (detailed within the previous paragraph) for each column.


Extended information

Function Syntax

VB Syntax


String CTLegPortfolio.FloatLegPortfolio( _
String Key, _
Long Reload, _
String GroupedIndex, _
String YCKey, _
String IRVolCurve, _
Variant FLTRange)


Excel Spreadsheet Syntax


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


C++ Syntax


static std::string FloatLegPortfolio(
std::string Key,
long Reload,
std::string GroupedIndex,
std::string YCKey,
std::string IRVolCurve,
CTRangeDataCPP FLTRange);


DotNET Syntax


System.String CTLegPortfolioSA.FloatLegPortfolio(
System.String Key,
System.Int32 Reload,
System.String GroupedIndex,
System.String YCKey,
System.String IRVolCurve,
CTRangeData FLTRange);

Parameter data types

ArgNameArgTypeIsKey
KeyStringFALSE
ReloadLongFALSE
GroupedIndexStringTRUE
YCKeyStringTRUE
IRVolCurveStringTRUE
FLTRangeRangeFALSE


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
KeyFALSEMyFloatLegPortfolio
ReloadFALSE1
GroupedIndexFALSEGroupedIndexNAME.EXTTAG.TICKER (from a function call)
YCKeyFALSEYCKeyNAME.EXTTAG.TICKER (from a function call)
IRVolCurveTRUEIRVolCurveNAME.EXTTAG.TICKER (from a function call)
FLTRangeFALSEFloatLegPortfolio_FLTRange_Range (creates a range object)


Example range for parameter : FLTRange

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

FLTNamePayRecStartDateEndDateNotionalIndexCodeInArrearsMarginCMSRho
FLT-123456reciever24/Jan/200524/Jan/201050000000EURLIBOR3MFalse0.00020
FLT : 25-Jul-2005 - EURLIBOR6Mreciever25/Jul/200525/Jul/201050000000EURLIBOR6MFalse0.00020
FLT : 25-Jan-2006 - EURLIBOR6Mpayer25/Jan/200625/Jan/201110000000EURLIBOR6MTrue0.00020
FLT : 25-Jul-2006 - EURCMS5Ypayer25/Jul/200625/Jul/201110000000EURCMS5YTrue0.00020.8
FLT : 25-Jan-2007 - EURCMS5Ypayer25/Jan/200725/Jan/201210000000EURCMS5YTrue0.00020.8

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



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

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

FloatLegPortfolio_FLTRange_builder.Append("{");
FloatLegPortfolio_FLTRange_builder.Append("FLTName	 | PayRec	 | StartDate	 | EndDate	 | Notional	 | IndexCode	 | InArrears	 | Margin	 | CMSRho ;");
FloatLegPortfolio_FLTRange_builder.Append("FLT-123456	 | reciever	 | #24/Jan/2005#	 | #24/Jan/2010#	 | 50000000	 | EURLIBOR3M	 | False	 | 0.0002	 | 0 ;");
FloatLegPortfolio_FLTRange_builder.Append("FLT : 25-Jul-2005 - EURLIBOR6M	 | reciever	 | #25/Jul/2005#	 | #25/Jul/2010#	 | 50000000	 | EURLIBOR6M	 | False	 | 0.0002	 | 0 ;");
FloatLegPortfolio_FLTRange_builder.Append("FLT : 25-Jan-2006 - EURLIBOR6M	 | payer	 | #25/Jan/2006#	 | #25/Jan/2011#	 | 10000000	 | EURLIBOR6M	 | True	 | 0.0002	 | 0 ;");
FloatLegPortfolio_FLTRange_builder.Append("FLT : 25-Jul-2006 - EURCMS5Y	 | payer	 | #25/Jul/2006#	 | #25/Jul/2011#	 | 10000000	 | EURCMS5Y	 | True	 | 0.0002	 | 0.8 ;");
FloatLegPortfolio_FLTRange_builder.Append("FLT : 25-Jan-2007 - EURCMS5Y	 | payer	 | #25/Jan/2007#	 | #25/Jan/2012#	 | 10000000	 | EURCMS5Y	 | True	 | 0.0002	 | 0.8");
FloatLegPortfolio_FLTRange_builder.Append("}");

// Parse the string into the Range object.
FloatLegPortfolio_FLTRange.RangeFromStr( FloatLegPortfolio_FLTRange_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 FloatLegPortfolio() 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 FloatLegPortfolio() function call


MyFloatLegPortfolio_6.FBOOKFLT.0

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