ZeroCouponBond_y





http://www.QuantTools.com
CapeTools Bonds (Yield) function list

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

Key TAGs | Excel Index | API Index



Creates a ZeroCoupon bond object.

The bond takes as input the Bond's yield.

This yield will be used to discount the Bond flows.

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



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




High level graphic of ZeroCouponBond_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. 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. BondYield parameter

    The Bond's yield value.
  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_y.ZeroCouponBond_y( _
String Key, _
Long Reload, _
CCYEnum Ccy, _
Long SettleDate, _
Long matDate, _
DayCountEnum dayCounter, _
String calKey, _
BDCEnum BusDayConv, _
Double redemption, _
Double BondYield, _
FreqEnum YieldQuoteFreq, _
String YieldQMethod)


Excel Spreadsheet Syntax


=CT.BOND.ZeroCouponBond_y(
Excel String Cell Key,
Excel Numeric Cell Reload,
Excel String Cell Ccy,
Excel Numeric Cell SettleDate,
Excel Numeric Cell matDate,
Excel String Cell dayCounter,
Excel String Cell calKey,
Excel String Cell BusDayConv,
Excel Numeric Cell redemption,
Excel Numeric Cell BondYield,
Excel String Cell YieldQuoteFreq,
Excel String Cell YieldQMethod)


C++ Syntax


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


DotNET Syntax


System.String CTBonds_ySA.ZeroCouponBond_y(
System.String Key,
System.Int32 Reload,
CTIEnums.CCYEnum Ccy,
System.Int32 SettleDate,
System.Int32 matDate,
CTIEnums.DayCountEnum dayCounter,
System.String calKey,
CTIEnums.BDCEnum BusDayConv,
System.Double redemption,
System.Double BondYield,
CTIEnums.FreqEnum YieldQuoteFreq,
System.String YieldQMethod);

Parameter data types

ArgNameArgTypeIsKey
KeyStringFALSE
ReloadLongFALSE
CcyCCYEnumFALSE
SettleDateLongFALSE
matDateLongFALSE
dayCounterDayCountEnumFALSE
calKeyStringTRUE
BusDayConvBDCEnumFALSE
redemptionDoubleFALSE
BondYieldDoubleFALSE
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_y
ReloadFALSE1
CcyFALSEEUR
SettleDateFALSE19/Jul/2005 (serial date type)
matDateFALSE21/Jul/2007 (serial date type)
dayCounterFALSEACT365F
calKeyFALSEcalKeyNAME.EXTTAG.TICKER (from a function call)
BusDayConvFALSEModifiedFollowing
redemptionFALSE100
BondYieldFALSE0.055
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_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 ZeroCouponBond_y() function call


MyZeroCouponBond_y_5.ZCBND_Y.0

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