FixedLegPortfolio





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 fixed rate leg portfolio object.

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 fixed 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 : "FBOOKFIX"



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




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

    Calendar Key required for holiday adjustments.
  4. YCKey parameter

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

    A 9 column Swap range : 'FIXName', 'PayRec', 'StartDate', 'EndDate', 'Notional', 'Coupon', 'FixBDC', 'FixDayCount', 'FixFreq'. The range must contain the titles (detailed within the previous paragraph) for each column.


Extended information

Function Syntax

VB Syntax


String CTLegPortfolio.FixedLegPortfolio( _
String Key, _
Long Reload, _
String Cal, _
String YCKey, _
Variant FIXRange)


Excel Spreadsheet Syntax


=CT.BOOK.FixedLegPortfolio(
Excel String Cell Key,
Excel Numeric Cell Reload,
Excel String Cell Cal,
Excel String Cell YCKey,
XLRange FIXRange)


C++ Syntax


static std::string FixedLegPortfolio(
std::string Key,
long Reload,
std::string Cal,
std::string YCKey,
CTRangeDataCPP FIXRange);


DotNET Syntax


System.String CTLegPortfolioSA.FixedLegPortfolio(
System.String Key,
System.Int32 Reload,
System.String Cal,
System.String YCKey,
CTRangeData FIXRange);

Parameter data types

ArgNameArgTypeIsKey
KeyStringFALSE
ReloadLongFALSE
CalStringTRUE
YCKeyStringTRUE
FIXRangeRangeFALSE


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
KeyFALSEMyFixedLegPortfolio
ReloadFALSE1
CalFALSECalNAME.EXTTAG.TICKER (from a function call)
YCKeyFALSEYCKeyNAME.EXTTAG.TICKER (from a function call)
FIXRangeFALSEFixedLegPortfolio_FIXRange_Range (creates a range object)


Example range for parameter : FIXRange

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

FixNamePayRecStartDateEndDateNotionalCouponFixBDCFixDayCountFixFreq
FIX-123456reciever24/Jan/200524/Jan/2010500000005.11ModifiedfollowingACT365FQ
FIX : 25-Jul-2005 - 5.28%reciever25/Jul/200525/Jul/2010500000005.28ModifiedfollowingACT365FQ
FIX : 25-Jan-2006 - 5.44%reciever25/Jan/200625/Jan/2011100000005.44ModifiedfollowingACT365FS
FIX : 25-Jul-2006 - 5.57%reciever25/Jul/200625/Jul/2011100000005.57ModifiedfollowingACT365FS
FIX : 25-Jan-2007 - 5.77%reciever25/Jan/200725/Jan/2012100000005.77ModifiedfollowingACT365FS

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



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

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

FixedLegPortfolio_FIXRange_builder.Append("{");
FixedLegPortfolio_FIXRange_builder.Append("FixName	 | PayRec	 | StartDate	 | EndDate	 | Notional	 | Coupon	 | FixBDC	 | FixDayCount	 | FixFreq ;");
FixedLegPortfolio_FIXRange_builder.Append("FIX-123456	 | reciever	 | #24/Jan/2005#	 | #24/Jan/2010#	 | 50000000	 | 5.11	 | Modifiedfollowing	 | ACT365F	 | Q ;");
FixedLegPortfolio_FIXRange_builder.Append("FIX : 25-Jul-2005 - 5.28%	 | reciever	 | #25/Jul/2005#	 | #25/Jul/2010#	 | 50000000	 | 5.28	 | Modifiedfollowing	 | ACT365F	 | Q ;");
FixedLegPortfolio_FIXRange_builder.Append("FIX : 25-Jan-2006 - 5.44%	 | reciever	 | #25/Jan/2006#	 | #25/Jan/2011#	 | 10000000	 | 5.44	 | Modifiedfollowing	 | ACT365F	 | S ;");
FixedLegPortfolio_FIXRange_builder.Append("FIX : 25-Jul-2006 - 5.57%	 | reciever	 | #25/Jul/2006#	 | #25/Jul/2011#	 | 10000000	 | 5.57	 | Modifiedfollowing	 | ACT365F	 | S ;");
FixedLegPortfolio_FIXRange_builder.Append("FIX : 25-Jan-2007 - 5.77%	 | reciever	 | #25/Jan/2007#	 | #25/Jan/2012#	 | 10000000	 | 5.77	 | Modifiedfollowing	 | ACT365F	 | S");
FixedLegPortfolio_FIXRange_builder.Append("}");

// Parse the string into the Range object.
FixedLegPortfolio_FIXRange.RangeFromStr( FixedLegPortfolio_FIXRange_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 FixedLegPortfolio() 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 FixedLegPortfolio() function call


MyFixedLegPortfolio_1.FBOOKFIX.0

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