MKTYC_XCCY_D





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

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

Key TAGs | Excel Index | API Index



Creates a yield curve using market rates and cross currency swaps (against the dollar).

The aim of this curve is to produce both a discounting and fixing curve in one curve object.

Via the cross-currency swaps, the discount factors will be adjusted in order to price these cross-currency swaps as well as deposits, futures, FRAs and Swap instruments.

The latter instruments are priced correctly as internally a forward spread curve is created in order to adjust the fixing values computed (from the adjusted discount factors) back to a LIBOR type rate.

This curve is the preferred method when pricing interest rate deals or conducting interest rate risk (as opposed to specifying separate discounting and fixing curves) as there exists a relationship between the discounting factors and fixing rates.

(If you bump the inputs of the yieldcurve, the discount factors are adjusted correctly for the purpose of discounting a cashflow, this is not the case if you specify separate curves, the discounting factors do you move if you bump the fixing rates).

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

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



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




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

    A 2 or 3 column range of cross-currency tenors and spreads. The third column is an optional boolean column as to whether the spread 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. SpreadInterp parameter

    Interpolation methodology to utilise when interpolating the forward spread curve (generated from the cross-currency basis swaps). Possible values are : 'BackStep', (for a flat interpolation in the backwards direction), 'ForwardStep', (for a flat interpolation in the forwards direction), 'Linear' or 'LogLinear'.
  11. Spread parameter

    An optional flat spread value that will be added to all tenors (not the cross-currency swaps)).
  12. DayCount parameter

    DayCounter for converting dates into year fractions.
  13. 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).
  14. 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).
  15. 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.
  16. 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.
  17. 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 CTXCCYCurves.MKTYC_XCCY_D( _
String Key, _
Long Reload, _
String CurveName, _
String ValueDate, _
Variant oTenorsRates, _
Variant oRange2, _
Variant oRange3, _
Variant XCCYSwaps, _
InterpEnum InterpMethod, _
InterpEnum SpreadInterp, _
Double Spread, _
DayCountEnum DayCount, _
Boolean DepoOvrWrtFuts, _
Boolean FutsOvrWrtSwps, _
String DepoIndex, _
String SwapIndex, _
Boolean Extrapolate)


Excel Spreadsheet Syntax


=CT.CRV.MKTYC_XCCY_D(
Excel String Cell Key,
Excel Numeric Cell Reload,
Excel String Cell CurveName,
Excel String Cell ValueDate,
XLRange oTenorsRates,
XLRange oRange2,
XLRange oRange3,
XLRange XCCYSwaps,
Excel String Cell InterpMethod,
Excel String Cell SpreadInterp,
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_XCCY_D(
std::string Key,
long Reload,
std::string CurveName,
std::string ValueDate,
CTRangeDataCPP oTenorsRates,
CTRangeDataCPP oRange2,
CTRangeDataCPP oRange3,
CTRangeDataCPP XCCYSwaps,
InterpEnum InterpMethod,
InterpEnum SpreadInterp,
double Spread,
DayCountEnum DayCount,
bool DepoOvrWrtFuts,
bool FutsOvrWrtSwps,
std::string DepoIndex,
std::string SwapIndex,
bool Extrapolate);


DotNET Syntax


System.String CTXCCYCurvesSA.MKTYC_XCCY_D(
System.String Key,
System.Int32 Reload,
System.String CurveName,
System.String ValueDate,
CTRangeData oTenorsRates,
CTRangeData oRange2,
CTRangeData oRange3,
CTRangeData XCCYSwaps,
CTIEnums.InterpEnum InterpMethod,
CTIEnums.InterpEnum SpreadInterp,
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
XCCYSwapsRangeFALSE
InterpMethodInterpEnumFALSE
SpreadInterpInterpEnumFALSE
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_XCCY_DCF
ReloadFALSE1
CurveNameTRUEMyYC_XCCY_DCF
ValueDateFALSEValueDateNAME.EXTTAG.TICKER (from a function call)
oTenorsRatesFALSEMKTYC_XCCY_D_oTenorsRates_Range (creates a range object)
oRange2TRUEMKTYC_XCCY_D_oRange2_Range (creates a range object)
oRange3TRUEMKTYC_XCCY_D_oRange3_Range (creates a range object)
XCCYSwapsFALSEMKTYC_XCCY_D_XCCYSwaps_Range (creates a range object)
InterpMethodFALSELogLinear
SpreadInterpFALSEForwardStep
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.55True
3M3.57True
4M3.59True
5M3.62True
6M3.63True
7M3.66True
8M3.68True
9M3.71True
10M3.73True
11M3.75True

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



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

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

MKTYC_XCCY_D_oTenorsRates_builder.Append("{");
MKTYC_XCCY_D_oTenorsRates_builder.Append("'7D'	 | 3.5	 | True ;");
MKTYC_XCCY_D_oTenorsRates_builder.Append("'14D'	 | 3.51	 | True ;");
MKTYC_XCCY_D_oTenorsRates_builder.Append("'1M'	 | 3.53	 | True ;");
MKTYC_XCCY_D_oTenorsRates_builder.Append("'2M'	 | 3.55	 | True ;");
MKTYC_XCCY_D_oTenorsRates_builder.Append("'3M'	 | 3.57	 | True ;");
MKTYC_XCCY_D_oTenorsRates_builder.Append("'4M'	 | 3.59	 | True ;");
MKTYC_XCCY_D_oTenorsRates_builder.Append("'5M'	 | 3.62	 | True ;");
MKTYC_XCCY_D_oTenorsRates_builder.Append("'6M'	 | 3.63	 | True ;");
MKTYC_XCCY_D_oTenorsRates_builder.Append("'7M'	 | 3.66	 | True ;");
MKTYC_XCCY_D_oTenorsRates_builder.Append("'8M'	 | 3.68	 | True ;");
MKTYC_XCCY_D_oTenorsRates_builder.Append("'9M'	 | 3.71	 | True ;");
MKTYC_XCCY_D_oTenorsRates_builder.Append("'10M'	 | 3.73	 | True ;");
MKTYC_XCCY_D_oTenorsRates_builder.Append("'11M'	 | 3.75	 | True");
MKTYC_XCCY_D_oTenorsRates_builder.Append("}");

// Parse the string into the Range object.
MKTYC_XCCY_D_oTenorsRates.RangeFromStr( MKTYC_XCCY_D_oTenorsRates_builder.ToString() );


Example range for parameter : oRange2

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

1Y3.75True
2Y3.8True
5Y3.85True
10Y3.9True
15Y4.15True

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



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

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

MKTYC_XCCY_D_oRange2_builder.Append("{");
MKTYC_XCCY_D_oRange2_builder.Append("'1Y'	 | 3.75	 | True ;");
MKTYC_XCCY_D_oRange2_builder.Append("'2Y'	 | 3.8	 | True ;");
MKTYC_XCCY_D_oRange2_builder.Append("'5Y'	 | 3.85	 | True ;");
MKTYC_XCCY_D_oRange2_builder.Append("'10Y'	 | 3.9	 | True ;");
MKTYC_XCCY_D_oRange2_builder.Append("'15Y'	 | 4.15	 | True");
MKTYC_XCCY_D_oRange2_builder.Append("}");

// Parse the string into the Range object.
MKTYC_XCCY_D_oRange2.RangeFromStr( MKTYC_XCCY_D_oRange2_builder.ToString() );


Example range for parameter : oRange3

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

25Y4.3True
30Y4.45True
35Y4.6True
40Y4.9True

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



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

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

MKTYC_XCCY_D_oRange3_builder.Append("{");
MKTYC_XCCY_D_oRange3_builder.Append("'25Y'	 | 4.3	 | True ;");
MKTYC_XCCY_D_oRange3_builder.Append("'30Y'	 | 4.45	 | True ;");
MKTYC_XCCY_D_oRange3_builder.Append("'35Y'	 | 4.6	 | True ;");
MKTYC_XCCY_D_oRange3_builder.Append("'40Y'	 | 4.9	 | True");
MKTYC_XCCY_D_oRange3_builder.Append("}");

// Parse the string into the Range object.
MKTYC_XCCY_D_oRange3.RangeFromStr( MKTYC_XCCY_D_oRange3_builder.ToString() );


Example range for parameter : XCCYSwaps

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

1Y-3.5True
2Y-3True
3Y-3.25True
4Y-3.25True
5Y-3.25True
7Y-3.25True
10Y-3.25True
15Y-3True
20Y-2.75True
30Y-2.75True

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



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

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

MKTYC_XCCY_D_XCCYSwaps_builder.Append("{");
MKTYC_XCCY_D_XCCYSwaps_builder.Append("'1Y'	 | -3.5	 | True ;");
MKTYC_XCCY_D_XCCYSwaps_builder.Append("'2Y'	 | -3	 | True ;");
MKTYC_XCCY_D_XCCYSwaps_builder.Append("'3Y'	 | -3.25	 | True ;");
MKTYC_XCCY_D_XCCYSwaps_builder.Append("'4Y'	 | -3.25	 | True ;");
MKTYC_XCCY_D_XCCYSwaps_builder.Append("'5Y'	 | -3.25	 | True ;");
MKTYC_XCCY_D_XCCYSwaps_builder.Append("'7Y'	 | -3.25	 | True ;");
MKTYC_XCCY_D_XCCYSwaps_builder.Append("'10Y'	 | -3.25	 | True ;");
MKTYC_XCCY_D_XCCYSwaps_builder.Append("'15Y'	 | -3	 | True ;");
MKTYC_XCCY_D_XCCYSwaps_builder.Append("'20Y'	 | -2.75	 | True ;");
MKTYC_XCCY_D_XCCYSwaps_builder.Append("'30Y'	 | -2.75	 | True");
MKTYC_XCCY_D_XCCYSwaps_builder.Append("}");

// Parse the string into the Range object.
MKTYC_XCCY_D_XCCYSwaps.RangeFromStr( MKTYC_XCCY_D_XCCYSwaps_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_XCCY_D() 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_XCCY_D() function call


MyYC_XCCY_DCF_1.MYCX_D.0

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