REPOYC_F





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

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

Key TAGs | Excel Index | API Index



Creates a Repo (repurchase) rate curve using market repurchase (repo) rates.

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

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

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



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




High level graphic of REPOYC_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. ValueDate parameter

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

    A 2 or 3 column range of tenors and repo rates.
  5. 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'.
  6. Spread parameter

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

    DayCounter to use
  8. 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
  9. BusDayConv parameter

    Business Day Convention. treatment of date adjustments
  10. 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 CTRepoCurves.REPOYC_F( _
String Key, _
Long Reload, _
String ValueDate, _
Variant oTenorsRates, _
InterpEnum InterpMethod, _
Double Spread, _
DayCountEnum DayCount, _
String Cal, _
BDCEnum BusDayConv, _
Boolean Extrapolate)


Excel Spreadsheet Syntax


=CT.CRV.REPOYC_F(
Excel String Cell Key,
Excel Numeric Cell Reload,
Excel String Cell ValueDate,
XLRange oTenorsRates,
Excel String Cell InterpMethod,
Excel Numeric Cell Spread,
Excel String Cell DayCount,
Excel String Cell Cal,
Excel String Cell BusDayConv,
Excel Boolean Value Cell Extrapolate)


C++ Syntax


static std::string REPOYC_F(
std::string Key,
long Reload,
std::string ValueDate,
CTRangeDataCPP oTenorsRates,
InterpEnum InterpMethod,
double Spread,
DayCountEnum DayCount,
std::string Cal,
BDCEnum BusDayConv,
bool Extrapolate);


DotNET Syntax


System.String CTRepoCurvesSA.REPOYC_F(
System.String Key,
System.Int32 Reload,
System.String ValueDate,
CTRangeData oTenorsRates,
CTIEnums.InterpEnum InterpMethod,
System.Double Spread,
CTIEnums.DayCountEnum DayCount,
System.String Cal,
CTIEnums.BDCEnum BusDayConv,
System.Boolean Extrapolate);

Parameter data types

ArgNameArgTypeIsKey
KeyStringFALSE
ReloadLongFALSE
ValueDateStringTRUE
oTenorsRatesRangeFALSE
InterpMethodInterpEnumFALSE
SpreadDoubleFALSE
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
KeyFALSEMyRepo_InterpOnFwd
ReloadFALSE1
ValueDateFALSEValueDateNAME.EXTTAG.TICKER (from a function call)
oTenorsRatesFALSEREPOYC_F_oTenorsRates_Range (creates a range object)
InterpMethodFALSEForwardStep
SpreadTRUE0.000
DayCountFALSEACT365F
CalFALSECalNAME.EXTTAG.TICKER (from a function call)
BusDayConvFALSEModifiedFollowing
ExtrapolateFALSEtrue


Example range for parameter : oTenorsRates

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

1M3.31True
2M3.33True
3M3.35True
4M3.37True
5M3.39True
6M3.41True
7M3.42True
8M3.43True
9M3.45True
10M3.46True
11M3.47True
1Y3.51True
2Y3.55True

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



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

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

REPOYC_F_oTenorsRates_builder.Append("{");
REPOYC_F_oTenorsRates_builder.Append("'1M'	 | 3.31	 | True ;");
REPOYC_F_oTenorsRates_builder.Append("'2M'	 | 3.33	 | True ;");
REPOYC_F_oTenorsRates_builder.Append("'3M'	 | 3.35	 | True ;");
REPOYC_F_oTenorsRates_builder.Append("'4M'	 | 3.37	 | True ;");
REPOYC_F_oTenorsRates_builder.Append("'5M'	 | 3.39	 | True ;");
REPOYC_F_oTenorsRates_builder.Append("'6M'	 | 3.41	 | True ;");
REPOYC_F_oTenorsRates_builder.Append("'7M'	 | 3.42	 | True ;");
REPOYC_F_oTenorsRates_builder.Append("'8M'	 | 3.43	 | True ;");
REPOYC_F_oTenorsRates_builder.Append("'9M'	 | 3.45	 | True ;");
REPOYC_F_oTenorsRates_builder.Append("'10M'	 | 3.46	 | True ;");
REPOYC_F_oTenorsRates_builder.Append("'11M'	 | 3.47	 | True ;");
REPOYC_F_oTenorsRates_builder.Append("'1Y'	 | 3.51	 | True ;");
REPOYC_F_oTenorsRates_builder.Append("'2Y'	 | 3.55	 | True");
REPOYC_F_oTenorsRates_builder.Append("}");

// Parse the string into the Range object.
REPOYC_F_oTenorsRates.RangeFromStr( REPOYC_F_oTenorsRates_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 REPOYC_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 REPOYC_F() function call


MyRepo_InterpOnFwd_3.REPOYC_F.0

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