ZeroCurve





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

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

Key TAGs | Excel Index | API Index



Creates a simple zero curve from FRA Tenors (or Dates) and zero rates.

The zero rates covers the period between today and the current tenor.

This curve cannot be used to determine interest rate market rates (SWAP rates , CMS rates etc...).

You can use this curve to compute discount factors, forward rates and zero rates.

If you do want to use market information that can price various financial products (Bonds, Swaps, various legs etc...) use one of the following category of functions : CapeTools Curves, CapeTools XCCY Curves or CapeTools Bond Curves or you can employ a risky curve via Credit Default Curves (CapeTools Credit Curves).

(You cannot use the DiscountCurve(), ForwardCurve(), ZeroCurve() or FlatYieldCurve() functions as these do not contain enough information for pricing.).

These curves take in extra information pertaining to the interest rate market and can be used to also prices interest rate deals (in regards to the computation of fixing or reset rates).



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



Note: Within Excel, the function is named - CT.CRV.ZeroCurve




High level graphic of ZeroCurve() function with parameters. Blue square node is the actual function with the parameters ordered.



Parameter Description


  1. Key parameter

    Key value to use as a handle for the created 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. ValueDate parameter

    Key to an already created Valuation Date Object. (Via the ValueDateObj() function).
  4. oTenorsVals parameter

    A 2 column range of Tenors (or Dates) and zero rates.
  5. DayCount parameter

    DayCounter to use
  6. Cal parameter

    Calendar to use for the adjustment of dates that lands on a holiday or weekend, if you use the EmptyCalendar() function, no adjustments will be made
  7. BusDayConv parameter

    Business Day Convention. treatment of date adjustments
  8. Extrapolate parameter

    Whether the yieldCurve data should be extrapolated if a calculation request that uses a date that is beyond the end date of the yieldCurve (ie - a request for a 40 year discount factor, but the curve is only built up to 30 years.) If false an error will be returned. This setting is set globally for the whole curve. The extrapolation is conducted by computing a daily compounded forward rate between the last two points of the yieldcurve and then using this to estimate distant discount factor points.


Extended information

Function Syntax

VB Syntax


String CTCurves.ZeroCurve( _
String Key, _
Long Reload, _
String ValueDate, _
Variant oTenorsVals, _
DayCountEnum DayCount, _
String Cal, _
BDCEnum BusDayConv, _
Boolean Extrapolate)


Excel Spreadsheet Syntax


=CT.CRV.ZeroCurve(
Excel String Cell Key,
Excel Numeric Cell Reload,
Excel String Cell ValueDate,
XLRange oTenorsVals,
Excel String Cell DayCount,
Excel String Cell Cal,
Excel String Cell BusDayConv,
Excel Boolean Value Cell Extrapolate)


C++ Syntax


static std::string ZeroCurve(
std::string Key,
long Reload,
std::string ValueDate,
CTRangeDataCPP oTenorsVals,
DayCountEnum DayCount,
std::string Cal,
BDCEnum BusDayConv,
bool Extrapolate);


DotNET Syntax


System.String CTCurvesSA.ZeroCurve(
System.String Key,
System.Int32 Reload,
System.String ValueDate,
CTRangeData oTenorsVals,
CTIEnums.DayCountEnum DayCount,
System.String Cal,
CTIEnums.BDCEnum BusDayConv,
System.Boolean Extrapolate);

Parameter data types

ArgNameArgTypeIsKey
KeyStringFALSE
ReloadLongFALSE
ValueDateStringTRUE
oTenorsValsRangeFALSE
DayCountDayCountEnumFALSE
CalStringTRUE
BusDayConvBDCEnumFALSE
ExtrapolateBooleanFALSE


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
KeyFALSEMyZeroCurve
ReloadFALSE1
ValueDateFALSEValueDateNAME.EXTTAG.TICKER (from a function call)
oTenorsValsFALSEZeroCurve_oTenorsVals_Range (creates a range object)
DayCountFALSEACT365F
CalFALSECalNAME.EXTTAG.TICKER (from a function call)
BusDayConvFALSEModifiedFollowing
ExtrapolateFALSEtrue


Example range for parameter : oTenorsVals

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

1M3.53True
2M3.54True
3M3.55True
4M3.58True
5M3.6True
6M3.62True
7M3.64True
8M3.67True
9M3.7True
10M3.72True
11M3.73True
2Y3.78True
3Y3.82True
4Y3.85True
5Y3.89True
6Y3.93True
7Y3.98True
8Y4True
9Y4.03True
10Y4.07True
11Y4.09True
12Y4.12True
13Y4.17True
14Y4.2True
15Y4.24True
16Y4.28True
17Y4.31True
18Y4.35True
19Y4.38True
20Y4.41True
21Y4.45True

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



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

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

ZeroCurve_oTenorsVals_builder.Append("{");
ZeroCurve_oTenorsVals_builder.Append("'1M'	 | 3.53	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'2M'	 | 3.54	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'3M'	 | 3.55	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'4M'	 | 3.58	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'5M'	 | 3.6	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'6M'	 | 3.62	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'7M'	 | 3.64	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'8M'	 | 3.67	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'9M'	 | 3.7	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'10M'	 | 3.72	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'11M'	 | 3.73	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'2Y'	 | 3.78	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'3Y'	 | 3.82	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'4Y'	 | 3.85	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'5Y'	 | 3.89	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'6Y'	 | 3.93	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'7Y'	 | 3.98	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'8Y'	 | 4	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'9Y'	 | 4.03	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'10Y'	 | 4.07	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'11Y'	 | 4.09	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'12Y'	 | 4.12	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'13Y'	 | 4.17	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'14Y'	 | 4.2	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'15Y'	 | 4.24	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'16Y'	 | 4.28	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'17Y'	 | 4.31	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'18Y'	 | 4.35	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'19Y'	 | 4.38	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'20Y'	 | 4.41	 | True ;");
ZeroCurve_oTenorsVals_builder.Append("'21Y'	 | 4.45	 | True");
ZeroCurve_oTenorsVals_builder.Append("}");

// Parse the string into the Range object.
ZeroCurve_oTenorsVals.RangeFromStr( ZeroCurve_oTenorsVals_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.Curves20 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 ZeroCurve() 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 ZeroCurve() function call


MyZeroCurve_5.ZYC.0

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