ForwardCurve





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 forward curve from Tenors (or Dates) and forward rates (annual continuos act.365).

The forward rate covers the period between the previous Tenor (or date) and the current one.

Whether using Tenors or Dates, the first point must be a date value equal to the ValueDate value (passed into the 'ValueDate' parameter of this function).

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



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




High level graphic of ForwardCurve() 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 forward 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.ForwardCurve( _
String Key, _
Long Reload, _
String ValueDate, _
Variant oTenorsVals, _
DayCountEnum DayCount, _
String Cal, _
BDCEnum BusDayConv, _
Boolean Extrapolate)


Excel Spreadsheet Syntax


=CT.CRV.ForwardCurve(
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 ForwardCurve(
std::string Key,
long Reload,
std::string ValueDate,
CTRangeDataCPP oTenorsVals,
DayCountEnum DayCount,
std::string Cal,
BDCEnum BusDayConv,
bool Extrapolate);


DotNET Syntax


System.String CTCurvesSA.ForwardCurve(
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
KeyFALSEMyForwardCurve
ReloadFALSE1
ValueDateFALSEValueDateNAME.EXTTAG.TICKER (from a function call)
oTenorsValsFALSEForwardCurve_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.

19/Jul/20053.5True
2M3.53True
3M3.56True
4M3.57True
5M3.6True
6M3.61True
7M3.63True
8M3.66True
9M3.69True
10M3.72True
11M3.75True
12M3.78True
3Y3.82True
4Y3.87True
5Y3.9True
6Y3.92True
7Y3.95True
8Y4True
9Y4.04True
10Y4.06True
11Y4.1True
12Y4.13True
13Y4.17True
14Y4.19True
15Y4.22True
16Y4.27True
17Y4.32True
18Y4.35True
19Y4.4True
20Y4.42True
21Y4.46True
22Y4.48True

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



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

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

ForwardCurve_oTenorsVals_builder.Append("{");
ForwardCurve_oTenorsVals_builder.Append("#19/Jul/2005#	 | 3.5	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'2M'	 | 3.53	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'3M'	 | 3.56	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'4M'	 | 3.57	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'5M'	 | 3.6	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'6M'	 | 3.61	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'7M'	 | 3.63	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'8M'	 | 3.66	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'9M'	 | 3.69	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'10M'	 | 3.72	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'11M'	 | 3.75	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'12M'	 | 3.78	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'3Y'	 | 3.82	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'4Y'	 | 3.87	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'5Y'	 | 3.9	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'6Y'	 | 3.92	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'7Y'	 | 3.95	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'8Y'	 | 4	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'9Y'	 | 4.04	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'10Y'	 | 4.06	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'11Y'	 | 4.1	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'12Y'	 | 4.13	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'13Y'	 | 4.17	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'14Y'	 | 4.19	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'15Y'	 | 4.22	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'16Y'	 | 4.27	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'17Y'	 | 4.32	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'18Y'	 | 4.35	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'19Y'	 | 4.4	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'20Y'	 | 4.42	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'21Y'	 | 4.46	 | True ;");
ForwardCurve_oTenorsVals_builder.Append("'22Y'	 | 4.48	 | True");
ForwardCurve_oTenorsVals_builder.Append("}");

// Parse the string into the Range object.
ForwardCurve_oTenorsVals.RangeFromStr( ForwardCurve_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 ForwardCurve() 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 ForwardCurve() function call


MyForwardCurve_4.FYC.0

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