FixedMuniBond





http://www.QuantTools.com
CapeTools Municipal Bonds function list

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

Key TAGs | Excel Index | API Index



Creates a fixed municipal bond object.

A municipal bond object is made up of many serial bonds with different maturity dates.

A yieldcurve object will be associated with the object once created.

A 'BondKey' string value will be returned on a successful creation of the bond object.

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



Note: Within Excel, the function is named - CT.MUNIBOND.FixedMuniBond




High level graphic of FixedMuniBond() 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 Bond 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. Ccy parameter

    The currency code that you want to associate with the Bond.
  4. couponFreq parameter

    Coupon Frequency of the bond. Can use any of the Frequency codes contained within the 'CapeTools Frequency Enums' category of functions.
  5. dayCounter parameter

    DayCounter to use for the accrual periods of the bond.
  6. calKey parameter

    Key to an already constructed Calendar object. Used to adjust dates for holidays.
  7. BusDayConv parameter

    Business Day Convention to use.
  8. SettleDays parameter

    Number of days for the settlement of bond.
  9. exDivTenor parameter

    The Bond's ex-dividend tenor convention. Will be applied to each bond. The tenor is composed of 2 parts. The first being a positive valued numeric amount, the second, the units of the numeric amount. Possible values for the units are 'BD' (for business days - ie 3BD), 'CD' (for calendar days - ie 5CD) and 'M' (for months - ie 3M). To specify no ex-dividend treatment, enter the value ('none')
  10. YCKey parameter

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

    A 7 column range of Bond Information. The columns are : 'DatedDate', 'FirstCouponDate', 'PenultCouponDate', 'MaturityDate', 'Coupon', 'Notional', 'Redemption'. The columns 'DatedDate', 'FirstCouponDate' and 'PenultCouponDate' are optional (only required to define odd first or last coupon periods) so you can fill these with zeros. The 'DayCount' column corresponds to the accrual method for calculating the coupon amount in either an odd-first and/or an odd-last coupon period. It does not effect any other periods as in this other periods, the bonds are assumed to make level coupon payments.


Extended information

Function Syntax

VB Syntax


String CTMunicipalBonds.FixedMuniBond( _
String Key, _
Long Reload, _
CCYEnum Ccy, _
FreqEnum couponFreq, _
DayCountEnum dayCounter, _
String calKey, _
BDCEnum BusDayConv, _
Long SettleDays, _
String exDivTenor, _
String YCKey, _
Variant BondRange)


Excel Spreadsheet Syntax


=CT.MUNIBOND.FixedMuniBond(
Excel String Cell Key,
Excel Numeric Cell Reload,
Excel String Cell Ccy,
Excel String Cell couponFreq,
Excel String Cell dayCounter,
Excel String Cell calKey,
Excel String Cell BusDayConv,
Excel Numeric Cell SettleDays,
Excel String Cell exDivTenor,
Excel String Cell YCKey,
XLRange BondRange)


C++ Syntax


static std::string FixedMuniBond(
std::string Key,
long Reload,
CCYEnum Ccy,
FreqEnum couponFreq,
DayCountEnum dayCounter,
std::string calKey,
BDCEnum BusDayConv,
long SettleDays,
std::string exDivTenor,
std::string YCKey,
CTRangeDataCPP BondRange);


DotNET Syntax


System.String CTMunicipalBondsSA.FixedMuniBond(
System.String Key,
System.Int32 Reload,
CTIEnums.CCYEnum Ccy,
CTIEnums.FreqEnum couponFreq,
CTIEnums.DayCountEnum dayCounter,
System.String calKey,
CTIEnums.BDCEnum BusDayConv,
System.Int32 SettleDays,
System.String exDivTenor,
System.String YCKey,
CTRangeData BondRange);

Parameter data types

ArgNameArgTypeIsKey
KeyStringFALSE
ReloadLongFALSE
CcyCCYEnumFALSE
couponFreqFreqEnumFALSE
dayCounterDayCountEnumFALSE
calKeyStringTRUE
BusDayConvBDCEnumFALSE
SettleDaysLongFALSE
exDivTenorStringFALSE
YCKeyStringTRUE
BondRangeRangeFALSE


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
KeyFALSEMyFixedMuniBond
ReloadFALSE1
CcyFALSEEUR
couponFreqFALSES
dayCounterFALSE30360
calKeyFALSEcalKeyNAME.EXTTAG.TICKER (from a function call)
BusDayConvFALSEModifiedFollowing
SettleDaysFALSE0
exDivTenorFALSE3BD
YCKeyFALSEYCKeyNAME.EXTTAG.TICKER (from a function call)
BondRangeFALSEFixedMuniBond_BondRange_Range (creates a range object)


Example range for parameter : BondRange

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

21/Apr/20050021/Oct/20060.0516100100
21/Apr/20050021/Oct/20070.0527100100
21/Apr/20050021/Oct/20080.0537100100
21/Apr/20050021/Oct/20090.0548100100
21/Apr/20050021/Oct/20100.0561100100
21/Apr/20050021/Oct/20110.0573100100

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



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

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

FixedMuniBond_BondRange_builder.Append("{");
FixedMuniBond_BondRange_builder.Append("#21/Apr/2005#	 | 0	 | 0	 | #21/Oct/2006#	 | 0.0516	 | 100	 | 100 ;");
FixedMuniBond_BondRange_builder.Append("#21/Apr/2005#	 | 0	 | 0	 | #21/Oct/2007#	 | 0.0527	 | 100	 | 100 ;");
FixedMuniBond_BondRange_builder.Append("#21/Apr/2005#	 | 0	 | 0	 | #21/Oct/2008#	 | 0.0537	 | 100	 | 100 ;");
FixedMuniBond_BondRange_builder.Append("#21/Apr/2005#	 | 0	 | 0	 | #21/Oct/2009#	 | 0.0548	 | 100	 | 100 ;");
FixedMuniBond_BondRange_builder.Append("#21/Apr/2005#	 | 0	 | 0	 | #21/Oct/2010#	 | 0.0561	 | 100	 | 100 ;");
FixedMuniBond_BondRange_builder.Append("#21/Apr/2005#	 | 0	 | 0	 | #21/Oct/2011#	 | 0.0573	 | 100	 | 100");
FixedMuniBond_BondRange_builder.Append("}");

// Parse the string into the Range object.
FixedMuniBond_BondRange.RangeFromStr( FixedMuniBond_BondRange_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.Bonds20 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 FixedMuniBond() 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 FixedMuniBond() function call


MyFixedMuniBond_1.FMUNIBND.0

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