FixedMuniBond_y





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.

The bond takes as input the Bond's yield.

This yield will be used to discount the Bond flows.

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_Y"



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




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

    Settlement date of the Bond.
  5. couponFreq parameter

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

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

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

    Business Day Convention to use.
  9. BondYield parameter

    The Bond's yield value.
  10. 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')
  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. Finally the 'Yield' is assumed to be a compounded (via the ISMA methodology) yield.


Extended information

Function Syntax

VB Syntax


String CTMunicipalBonds.FixedMuniBond_y( _
String Key, _
Long Reload, _
CCYEnum Ccy, _
Long SettleDate, _
FreqEnum couponFreq, _
DayCountEnum dayCounter, _
String calKey, _
BDCEnum BusDayConv, _
Double BondYield, _
String exDivTenor, _
Variant BondRange)


Excel Spreadsheet Syntax


=CT.MUNIBOND.FixedMuniBond_y(
Excel String Cell Key,
Excel Numeric Cell Reload,
Excel String Cell Ccy,
Excel Numeric Cell SettleDate,
Excel String Cell couponFreq,
Excel String Cell dayCounter,
Excel String Cell calKey,
Excel String Cell BusDayConv,
Excel Numeric Cell BondYield,
Excel String Cell exDivTenor,
XLRange BondRange)


C++ Syntax


static std::string FixedMuniBond_y(
std::string Key,
long Reload,
CCYEnum Ccy,
long SettleDate,
FreqEnum couponFreq,
DayCountEnum dayCounter,
std::string calKey,
BDCEnum BusDayConv,
double BondYield,
std::string exDivTenor,
CTRangeDataCPP BondRange);


DotNET Syntax


System.String CTMunicipalBondsSA.FixedMuniBond_y(
System.String Key,
System.Int32 Reload,
CTIEnums.CCYEnum Ccy,
System.Int32 SettleDate,
CTIEnums.FreqEnum couponFreq,
CTIEnums.DayCountEnum dayCounter,
System.String calKey,
CTIEnums.BDCEnum BusDayConv,
System.Double BondYield,
System.String exDivTenor,
CTRangeData BondRange);

Parameter data types

ArgNameArgTypeIsKey
KeyStringFALSE
ReloadLongFALSE
CcyCCYEnumFALSE
SettleDateLongFALSE
couponFreqFreqEnumFALSE
dayCounterDayCountEnumFALSE
calKeyStringTRUE
BusDayConvBDCEnumFALSE
BondYieldDoubleFALSE
exDivTenorStringFALSE
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_y
ReloadFALSE1
CcyFALSEEUR
SettleDateFALSE19/Jul/2005 (serial date type)
couponFreqFALSES
dayCounterFALSE30360
calKeyFALSEcalKeyNAME.EXTTAG.TICKER (from a function call)
BusDayConvFALSEModifiedFollowing
BondYieldFALSE0.055
exDivTenorFALSE3BD
BondRangeFALSEFixedMuniBond_y_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.0518100100
21/Apr/20050021/Oct/20070.0536100100
21/Apr/20050021/Oct/20080.0549100100
21/Apr/20050021/Oct/20090.0568100100
21/Apr/20050021/Oct/20100.058100100
21/Apr/20050021/Oct/20110.0594100100

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



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

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

FixedMuniBond_y_BondRange_builder.Append("{");
FixedMuniBond_y_BondRange_builder.Append("#21/Apr/2005#	 | 0	 | 0	 | #21/Oct/2006#	 | 0.0518	 | 100	 | 100 ;");
FixedMuniBond_y_BondRange_builder.Append("#21/Apr/2005#	 | 0	 | 0	 | #21/Oct/2007#	 | 0.0536	 | 100	 | 100 ;");
FixedMuniBond_y_BondRange_builder.Append("#21/Apr/2005#	 | 0	 | 0	 | #21/Oct/2008#	 | 0.0549	 | 100	 | 100 ;");
FixedMuniBond_y_BondRange_builder.Append("#21/Apr/2005#	 | 0	 | 0	 | #21/Oct/2009#	 | 0.0568	 | 100	 | 100 ;");
FixedMuniBond_y_BondRange_builder.Append("#21/Apr/2005#	 | 0	 | 0	 | #21/Oct/2010#	 | 0.058	 | 100	 | 100 ;");
FixedMuniBond_y_BondRange_builder.Append("#21/Apr/2005#	 | 0	 | 0	 | #21/Oct/2011#	 | 0.0594	 | 100	 | 100");
FixedMuniBond_y_BondRange_builder.Append("}");

// Parse the string into the Range object.
FixedMuniBond_y_BondRange.RangeFromStr( FixedMuniBond_y_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_y() 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_y() function call


MyFixedMuniBond_y_2.FMUNIBND_Y.0

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