ZeroCouponBond





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

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

Key TAGs | Excel Index | API Index



Creates a ZeroCoupon bond object.

This object can be used to represent discount securities that are sold at a discount and pay no interest (ie - zero coupon Bonds, Treasury Bills, Banker's Acceptance etc...).

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



Note: Within Excel, the function is named - CT.BOND.ZeroCouponBond




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

    Number of days for the settlement of bonds.
  5. matDate parameter

    Maturity date of the bond.
  6. dayCounter parameter

    DayCounter to use for the bond. Used to calculate time in years.
  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. redemption parameter

    Redemption value of the bond.
  10. YCKey parameter

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

    The default yield to maturity quotation (for the output of yield values) frequency.
  12. YieldQMethod parameter

    Yield calculation quotation method for the instrument. Possible values are : 'Simple', 'Discount', 'ISMA' (Compounded on an Annual coupon frequency), 'Continuous' (for continuous compounding) or 'True' (Compounded on an Annual coupon frequency, but uses adjusted bond dates (adjusted for weekends and holidays)). Used for Yield-To-Maturity calculations.


Extended information

Function Syntax

VB Syntax


String CTBonds.ZeroCouponBond( _
String Key, _
Long Reload, _
CCYEnum Ccy, _
Long SettleDays, _
Long matDate, _
DayCountEnum dayCounter, _
String calKey, _
BDCEnum BusDayConv, _
Double redemption, _
String YCKey, _
FreqEnum YieldQuoteFreq, _
String YieldQMethod)


Excel Spreadsheet Syntax


=CT.BOND.ZeroCouponBond(
Excel String Cell Key,
Excel Numeric Cell Reload,
Excel String Cell Ccy,
Excel Numeric Cell SettleDays,
Excel Numeric Cell matDate,
Excel String Cell dayCounter,
Excel String Cell calKey,
Excel String Cell BusDayConv,
Excel Numeric Cell redemption,
Excel String Cell YCKey,
Excel String Cell YieldQuoteFreq,
Excel String Cell YieldQMethod)


C++ Syntax


static std::string ZeroCouponBond(
std::string Key,
long Reload,
CCYEnum Ccy,
long SettleDays,
long matDate,
DayCountEnum dayCounter,
std::string calKey,
BDCEnum BusDayConv,
double redemption,
std::string YCKey,
FreqEnum YieldQuoteFreq,
std::string YieldQMethod);


DotNET Syntax


System.String CTBondsSA.ZeroCouponBond(
System.String Key,
System.Int32 Reload,
CTIEnums.CCYEnum Ccy,
System.Int32 SettleDays,
System.Int32 matDate,
CTIEnums.DayCountEnum dayCounter,
System.String calKey,
CTIEnums.BDCEnum BusDayConv,
System.Double redemption,
System.String YCKey,
CTIEnums.FreqEnum YieldQuoteFreq,
System.String YieldQMethod);

Parameter data types

ArgNameArgTypeIsKey
KeyStringFALSE
ReloadLongFALSE
CcyCCYEnumFALSE
SettleDaysLongFALSE
matDateLongFALSE
dayCounterDayCountEnumFALSE
calKeyStringTRUE
BusDayConvBDCEnumFALSE
redemptionDoubleFALSE
YCKeyStringTRUE
YieldQuoteFreqFreqEnumFALSE
YieldQMethodStringFALSE


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
KeyFALSEMyZeroCouponBond
ReloadFALSE1
CcyFALSEEUR
SettleDaysFALSE2
matDateFALSE21/Jul/2007 (serial date type)
dayCounterFALSEACT365F
calKeyFALSEcalKeyNAME.EXTTAG.TICKER (from a function call)
BusDayConvFALSEModifiedFollowing
redemptionFALSE100
YCKeyFALSEYCKeyNAME.EXTTAG.TICKER (from a function call)
YieldQuoteFreqFALSEA
YieldQMethodFALSEISMA


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 ZeroCouponBond() 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 ZeroCouponBond() function call


MyZeroCouponBond_5.ZCBND.0

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