MKTYC_F





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

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

Key TAGs | Excel Index | API Index



Creates a yield curve using market rates (No cross-currency Swaps).

This curve will apply an interpolation methodology ('BackStep', 'ForwardStep', 'Linear', 'LogLinear' or 'Cubic' via the 'InterpMethod' parameter) upon the FORWARD RATES.

This curve can be used for retrieving forward rates, discount factors and zero rates.

Can also be used to price market instruments, deposits, futures, FRAs, CMS and Swap rates.

This function requires the input of a IndexKey template object key, which must have been produced via a call to CreateDepoTemplate(). This function would have returned a string 'KEY' which is to be passed to the 'DepoIndex' parameter of this function.

This function requires the input of a SWAP IndexKey template object key, which must have been produced via a call to CreateSwapTemplate(). This function would have returned a string 'KEY' which is to be passed to the 'Swap Index' parameter of this function.

This function requires the input of a Calendar object key, which must have been produced via a call to one of the Calendar creation functions present within the CapeTools Calendars category of functions.

These functions would have returned a string 'KEY' which is to be passed to the 'Cal' parameter of this function.

For the 'DayCount' and 'BusDayConv' parameters, please refer to the large number of enumeration functions present within the CapeTools Enums category of functions.

The CapeTools Enums category of functions return correct string codes that can be passed to parameters taking fixed string values defined by the library (ie - DayCount codes, frequency codes, currency codes, compounding codes, business day convention codes etc...).

You can thus execute these enumeration functions which return the proper code, instead of trying to remember the string code needed or making spelling mistakes which can be difficult to debug.



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



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




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

    A tag used to identify this curve (case insensitive) if placed within a Yieldcurve collection ( via the GroupedCurves() function ). If you pass in an empty string, it will default to the name of the 'Key' parameter.
  4. ValueDate parameter

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

    A 2 or 3 column range of rates tenors (can be deposits, futures, FRAS or swaps) and rates. Futures tenors are inputted via futures codes (where the underlying is a 3M contract). The first character must be one of : F, G, H, J, K, M, N, Q, U, V, X or Z and these correspond to the third Wednesday of January, February, March, April, May, June, July, August, September, October, November and December respectively. The next two characters denote the year. Thus 'Z07' denotes the expiry date for a 3M futures contract that expires on the third Wednesday of December 2007. The optional 3rd column is a boolean column indicating whether you wish to utilise the tenor. For futures instruments, you can execute the FutAdj_HW() or FutAdj_KN() functions (with
    the 'OutputType' parameter set to AdjPrice) in order to compute a convexity adjusted futures price.
  6. oRange2 parameter

    An optional 2 or 3 column range of rates tenors (can be deposits, futures, FRAS or swaps), rates or future prices and an optional boolean column as to whether the rate is to be used within the building of the yieldcurve.
  7. oRange3 parameter

    An optional 2 or 3 column range of rates tenors (can be deposits, futures, FRAS or swaps), rates or future prices and an optional boolean column as to whether the rate is to be used within the building of the yieldcurve.
  8. oRange4 parameter

    An optional 2 or 3 column range of rates tenors (can be deposits, futures, FRAS or swaps), rates or future prices and an optional boolean column as to whether the rate is to be used within the building of the yieldcurve.
  9. InterpMethod parameter

    Interpolation methodology to utilise when interpolating for discount factors. Possible values are : 'BackStep', (for a flat interpolation in the backwards direction), 'ForwardStep', (for a flat interpolation in the forwards direction), 'Linear' or 'LogLinear'.
  10. Spread parameter

    An optional flat spread value that will be added to all tenors.
  11. DayCount parameter

    DayCounter for converting dates into year fractions.
  12. DepoOvrWrtFuts parameter

    If a cash (deposit) tenor's end date is after the earliest futures expiry date within the curve, do we discard the cash tenor (false) or keep it (true).
  13. FutsOvrWrtSwps parameter

    If a futures tenor's end date is after the earliest swap tenor's end date within the curve, do we discard the futures tenor (false) or keep it (true).
  14. DepoIndex parameter

    Deposit (Libor) Index Template Key. (Created via the CreateDepoTemplate() function). This is the minimum definition of an interest rate index ( ie - LIBOR ) and is the one used by the curve. If this curve allows Deposit or FRA instrument as inputs, then the definition of those instruments are specified via this template (minus the 'Tenor' information). In addition, if this curve is passed to an Index creation function ( functions within the 'CapeTools Indexes' category of functions) then this index will serve as the definition of one side of an interest rate BasisSwap transaction. Basically, provides the definition of a BasisSwap between this index template and the index defined by the index-creation function.
  15. SwapIndex parameter

    Swap Index Template Key. (Created via the CreateSwapTemplate() function). This object provides the minimum definition of an interest rate Swap and is the one used by the curve. If this curve allows for Swap instrument as inputs, then the definition of those instruments are specified via this template. This object is also used by other functions when requesting a Swap rate without the underlying swap rate definition.
  16. 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.MKTYC_F( _
String Key, _
Long Reload, _
String CurveName, _
String ValueDate, _
Variant oTenorsRates, _
Variant oRange2, _
Variant oRange3, _
Variant oRange4, _
InterpEnum InterpMethod, _
Double Spread, _
DayCountEnum DayCount, _
Boolean DepoOvrWrtFuts, _
Boolean FutsOvrWrtSwps, _
String DepoIndex, _
String SwapIndex, _
Boolean Extrapolate)


Excel Spreadsheet Syntax


=CT.CRV.MKTYC_F(
Excel String Cell Key,
Excel Numeric Cell Reload,
Excel String Cell CurveName,
Excel String Cell ValueDate,
XLRange oTenorsRates,
XLRange oRange2,
XLRange oRange3,
XLRange oRange4,
Excel String Cell InterpMethod,
Excel Numeric Cell Spread,
Excel String Cell DayCount,
Excel Boolean Value Cell DepoOvrWrtFuts,
Excel Boolean Value Cell FutsOvrWrtSwps,
Excel String Cell DepoIndex,
Excel String Cell SwapIndex,
Excel Boolean Value Cell Extrapolate)


C++ Syntax


static std::string MKTYC_F(
std::string Key,
long Reload,
std::string CurveName,
std::string ValueDate,
CTRangeDataCPP oTenorsRates,
CTRangeDataCPP oRange2,
CTRangeDataCPP oRange3,
CTRangeDataCPP oRange4,
InterpEnum InterpMethod,
double Spread,
DayCountEnum DayCount,
bool DepoOvrWrtFuts,
bool FutsOvrWrtSwps,
std::string DepoIndex,
std::string SwapIndex,
bool Extrapolate);


DotNET Syntax


System.String CTCurvesSA.MKTYC_F(
System.String Key,
System.Int32 Reload,
System.String CurveName,
System.String ValueDate,
CTRangeData oTenorsRates,
CTRangeData oRange2,
CTRangeData oRange3,
CTRangeData oRange4,
CTIEnums.InterpEnum InterpMethod,
System.Double Spread,
CTIEnums.DayCountEnum DayCount,
System.Boolean DepoOvrWrtFuts,
System.Boolean FutsOvrWrtSwps,
System.String DepoIndex,
System.String SwapIndex,
System.Boolean Extrapolate);

Parameter data types

ArgNameArgTypeIsKey
KeyStringFALSE
ReloadLongFALSE
CurveNameStringFALSE
ValueDateStringTRUE
oTenorsRatesRangeFALSE
oRange2RangeFALSE
oRange3RangeFALSE
oRange4RangeFALSE
InterpMethodInterpEnumFALSE
SpreadDoubleFALSE
DayCountDayCountEnumFALSE
DepoOvrWrtFutsBooleanFALSE
FutsOvrWrtSwpsBooleanFALSE
DepoIndexStringTRUE
SwapIndexStringTRUE
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
KeyFALSEMyYC_InterpOnFwd
ReloadFALSE1
CurveNameTRUEMyYC_InterpOnFwd
ValueDateFALSEValueDateNAME.EXTTAG.TICKER (from a function call)
oTenorsRatesFALSEMKTYC_F_oTenorsRates_Range (creates a range object)
oRange2TRUEMKTYC_F_oRange2_Range (creates a range object)
oRange3TRUEMKTYC_F_oRange3_Range (creates a range object)
oRange4TRUEMKTYC_F_oRange4_Range (creates a range object)
InterpMethodFALSEForwardStep
SpreadTRUE0.000
DayCountFALSEACT365F
DepoOvrWrtFutsFALSEfalse
FutsOvrWrtSwpsFALSEtrue
DepoIndexFALSEDepoIndexNAME.EXTTAG.TICKER (from a function call)
SwapIndexFALSESwapIndexNAME.EXTTAG.TICKER (from a function call)
ExtrapolateFALSEtrue


Example range for parameter : oTenorsRates

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

7D3.5True
14D3.51True
1M3.53True
2M3.56True
3M3.58True
4M3.6True
5M3.62True
6M3.63True
7M3.66True
8M3.67True
9M3.69True
10M3.71True
11M3.74True

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



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

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

MKTYC_F_oTenorsRates_builder.Append("{");
MKTYC_F_oTenorsRates_builder.Append("'7D'	 | 3.5	 | True ;");
MKTYC_F_oTenorsRates_builder.Append("'14D'	 | 3.51	 | True ;");
MKTYC_F_oTenorsRates_builder.Append("'1M'	 | 3.53	 | True ;");
MKTYC_F_oTenorsRates_builder.Append("'2M'	 | 3.56	 | True ;");
MKTYC_F_oTenorsRates_builder.Append("'3M'	 | 3.58	 | True ;");
MKTYC_F_oTenorsRates_builder.Append("'4M'	 | 3.6	 | True ;");
MKTYC_F_oTenorsRates_builder.Append("'5M'	 | 3.62	 | True ;");
MKTYC_F_oTenorsRates_builder.Append("'6M'	 | 3.63	 | True ;");
MKTYC_F_oTenorsRates_builder.Append("'7M'	 | 3.66	 | True ;");
MKTYC_F_oTenorsRates_builder.Append("'8M'	 | 3.67	 | True ;");
MKTYC_F_oTenorsRates_builder.Append("'9M'	 | 3.69	 | True ;");
MKTYC_F_oTenorsRates_builder.Append("'10M'	 | 3.71	 | True ;");
MKTYC_F_oTenorsRates_builder.Append("'11M'	 | 3.74	 | True");
MKTYC_F_oTenorsRates_builder.Append("}");

// Parse the string into the Range object.
MKTYC_F_oTenorsRates.RangeFromStr( MKTYC_F_oTenorsRates_builder.ToString() );


Example range for parameter : oRange2

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

12X154.03True
15X184.07True
18X214.11True
21X244.15True
24X274.43True
27X304.48True
30X334.53True
33X364.58True
36X394.84True
39X424.9True
42X454.96True

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



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

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

MKTYC_F_oRange2_builder.Append("{");
MKTYC_F_oRange2_builder.Append("'12X15'	 | 4.03	 | True ;");
MKTYC_F_oRange2_builder.Append("'15X18'	 | 4.07	 | True ;");
MKTYC_F_oRange2_builder.Append("'18X21'	 | 4.11	 | True ;");
MKTYC_F_oRange2_builder.Append("'21X24'	 | 4.15	 | True ;");
MKTYC_F_oRange2_builder.Append("'24X27'	 | 4.43	 | True ;");
MKTYC_F_oRange2_builder.Append("'27X30'	 | 4.48	 | True ;");
MKTYC_F_oRange2_builder.Append("'30X33'	 | 4.53	 | True ;");
MKTYC_F_oRange2_builder.Append("'33X36'	 | 4.58	 | True ;");
MKTYC_F_oRange2_builder.Append("'36X39'	 | 4.84	 | True ;");
MKTYC_F_oRange2_builder.Append("'39X42'	 | 4.9	 | True ;");
MKTYC_F_oRange2_builder.Append("'42X45'	 | 4.96	 | True");
MKTYC_F_oRange2_builder.Append("}");

// Parse the string into the Range object.
MKTYC_F_oRange2.RangeFromStr( MKTYC_F_oRange2_builder.ToString() );


Example range for parameter : oRange3

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

5Y4.33True
7Y4.36True
9Y4.38True
11Y4.41True
13Y4.45True
15Y4.49True
17Y4.52True
19Y4.55True
21Y4.59True
23Y4.61True
25Y4.65True

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



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

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

MKTYC_F_oRange3_builder.Append("{");
MKTYC_F_oRange3_builder.Append("'5Y'	 | 4.33	 | True ;");
MKTYC_F_oRange3_builder.Append("'7Y'	 | 4.36	 | True ;");
MKTYC_F_oRange3_builder.Append("'9Y'	 | 4.38	 | True ;");
MKTYC_F_oRange3_builder.Append("'11Y'	 | 4.41	 | True ;");
MKTYC_F_oRange3_builder.Append("'13Y'	 | 4.45	 | True ;");
MKTYC_F_oRange3_builder.Append("'15Y'	 | 4.49	 | True ;");
MKTYC_F_oRange3_builder.Append("'17Y'	 | 4.52	 | True ;");
MKTYC_F_oRange3_builder.Append("'19Y'	 | 4.55	 | True ;");
MKTYC_F_oRange3_builder.Append("'21Y'	 | 4.59	 | True ;");
MKTYC_F_oRange3_builder.Append("'23Y'	 | 4.61	 | True ;");
MKTYC_F_oRange3_builder.Append("'25Y'	 | 4.65	 | True");
MKTYC_F_oRange3_builder.Append("}");

// Parse the string into the Range object.
MKTYC_F_oRange3.RangeFromStr( MKTYC_F_oRange3_builder.ToString() );


Example range for parameter : oRange4

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

30Y4.76True
31Y4.8True
32Y4.83True
33Y4.88True
34Y4.93True
35Y4.96True
36Y5.01True
37Y5.05True
38Y5.08True
39Y5.12True
40Y5.16True

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



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

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

MKTYC_F_oRange4_builder.Append("{");
MKTYC_F_oRange4_builder.Append("'30Y'	 | 4.76	 | True ;");
MKTYC_F_oRange4_builder.Append("'31Y'	 | 4.8	 | True ;");
MKTYC_F_oRange4_builder.Append("'32Y'	 | 4.83	 | True ;");
MKTYC_F_oRange4_builder.Append("'33Y'	 | 4.88	 | True ;");
MKTYC_F_oRange4_builder.Append("'34Y'	 | 4.93	 | True ;");
MKTYC_F_oRange4_builder.Append("'35Y'	 | 4.96	 | True ;");
MKTYC_F_oRange4_builder.Append("'36Y'	 | 5.01	 | True ;");
MKTYC_F_oRange4_builder.Append("'37Y'	 | 5.05	 | True ;");
MKTYC_F_oRange4_builder.Append("'38Y'	 | 5.08	 | True ;");
MKTYC_F_oRange4_builder.Append("'39Y'	 | 5.12	 | True ;");
MKTYC_F_oRange4_builder.Append("'40Y'	 | 5.16	 | True");
MKTYC_F_oRange4_builder.Append("}");

// Parse the string into the Range object.
MKTYC_F_oRange4.RangeFromStr( MKTYC_F_oRange4_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 MKTYC_F() 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 MKTYC_F() function call


MyYC_InterpOnFwd_11.MYC_F.0

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