FXForwardCurve





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

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

Key TAGs | Excel Index | API Index



Returns a forward FX curve (or forward FX points) given domestic and foreign interest rates, spot FX value and a list of forward dates.



Note: Within Excel, the function is named - CT.FX.FXForwardCurve




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



Parameter Description


  1. ValueDate parameter

    Valuation Date (typically equal to Today's date)
  2. ForwardDates parameter

    Array of ForwardDates
  3. spotFX parameter

    FXRate on the 'ValueDate' date (domestic/foreign).
  4. domesticCCY parameter

    domestic currency.
  5. domesticRate parameter

    Domestic Rate.
  6. domesticDC parameter

    The DayCounter of the 'domesticRate' parameter.
  7. foreignCCY parameter

    foreign currency.
  8. foreignRate parameter

    Foreign Rate.
  9. foreignDC parameter

    The DayCounter of the 'foreignRate' parameter.
  10. outputType parameter

    The type of output you wuld like to view. Possile values are 'FXForward' or 'FXPoints'.


Extended information

Function Syntax

VB Syntax


Variant CTCurrency.FXForwardCurve( _
Long ValueDate, _
Variant ForwardDates, _
Double spotFX, _
CCYEnum domesticCCY, _
Double domesticRate, _
DayCountEnum domesticDC, _
CCYEnum foreignCCY, _
Double foreignRate, _
DayCountEnum foreignDC, _
String outputType)


Excel Spreadsheet Syntax


=CT.FX.FXForwardCurve(
Excel Numeric Cell ValueDate,
XLRange ForwardDates,
Excel Numeric Cell spotFX,
Excel String Cell domesticCCY,
Excel Numeric Cell domesticRate,
Excel String Cell domesticDC,
Excel String Cell foreignCCY,
Excel Numeric Cell foreignRate,
Excel String Cell foreignDC,
Excel String Cell outputType)


C++ Syntax


static CTRangeDataCPP FXForwardCurve(
long ValueDate,
CTRangeDataCPP ForwardDates,
double spotFX,
CCYEnum domesticCCY,
double domesticRate,
DayCountEnum domesticDC,
CCYEnum foreignCCY,
double foreignRate,
DayCountEnum foreignDC,
std::string outputType);


DotNET Syntax


CTRangeData CTCurrencySA.FXForwardCurve(
System.Int32 ValueDate,
CTRangeData ForwardDates,
System.Double spotFX,
CTIEnums.CCYEnum domesticCCY,
System.Double domesticRate,
CTIEnums.DayCountEnum domesticDC,
CTIEnums.CCYEnum foreignCCY,
System.Double foreignRate,
CTIEnums.DayCountEnum foreignDC,
System.String outputType);

Parameter data types

ArgNameArgTypeIsKey
ValueDateLongFALSE
ForwardDatesRangeFALSE
spotFXDoubleFALSE
domesticCCYCCYEnumFALSE
domesticRateDoubleFALSE
domesticDCDayCountEnumFALSE
foreignCCYCCYEnumFALSE
foreignRateDoubleFALSE
foreignDCDayCountEnumFALSE
outputTypeStringFALSE


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
ValueDateFALSE19/Jul/2005 (serial date type)
ForwardDatesFALSEFXForwardCurve_ForwardDates_Range (creates a range object)
spotFXFALSE0.8
domesticCCYTRUEEUR
domesticRateFALSE0.05
domesticDCFALSEACT365F
foreignCCYTRUEGBP
foreignRateFALSE0.03
foreignDCFALSEACT365F
outputTypeFALSEFXForward


Example range for parameter : ForwardDates

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


Data is stored within the second column (Vector of data)..

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



CTQL.CTRangeData FXForwardCurve_ForwardDates;


int[] arrBFXForwardCurve_ForwardDates = {
CTQL.Date.serialNumber("21/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("23/10/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("22/1/2007", "dd/mm/yyyy"),
CTQL.Date.serialNumber("23/4/2007", "dd/mm/yyyy"),
CTQL.Date.serialNumber("23/7/2007", "dd/mm/yyyy"),
CTQL.Date.serialNumber("22/10/2007", "dd/mm/yyyy"),
CTQL.Date.serialNumber("21/1/2008", "dd/mm/yyyy"),
CTQL.Date.serialNumber("21/4/2008", "dd/mm/yyyy"),
CTQL.Date.serialNumber("21/7/2008", "dd/mm/yyyy"),
CTQL.Date.serialNumber("21/10/2008", "dd/mm/yyyy"),
CTQL.Date.serialNumber("21/1/2009", "dd/mm/yyyy"),
CTQL.Date.serialNumber("21/4/2009", "dd/mm/yyyy"),
CTQL.Date.serialNumber("21/7/2009", "dd/mm/yyyy"),
CTQL.Date.serialNumber("21/10/2009", "dd/mm/yyyy"),
CTQL.Date.serialNumber("21/1/2010", "dd/mm/yyyy"),
CTQL.Date.serialNumber("21/4/2010", "dd/mm/yyyy"),
CTQL.Date.serialNumber("21/7/2010", "dd/mm/yyyy"),
CTQL.Date.serialNumber("21/10/2010", "dd/mm/yyyy"),
CTQL.Date.serialNumber("21/1/2011", "dd/mm/yyyy"),
CTQL.Date.serialNumber("21/4/2011", "dd/mm/yyyy"),
CTQL.Date.serialNumber("21/7/2011", "dd/mm/yyyy")  //  Array Data

};

CTQL.IntVector arrFXForwardCurve_ForwardDates =
new  CTQL.IntVector(arrBFXForwardCurve_ForwardDates);

// Second parameter determines whether the array is a column array (false) or a row array (true)
FXForwardCurve_ForwardDates = new  CTQL.CTRangeData(arrFXForwardCurve_ForwardDates, false);



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 FXForwardCurve() 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.


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 FXForwardCurve() function call


Example
ForwardDateFXForward
389190.815617
390130.81947
391040.823147
391950.826771
392860.830345
393770.833868
394680.837342
395590.840768
396500.844147
397420.847517
398340.85084
399240.854048
400150.857248
401070.86044
401990.863589
402890.86663
403800.869665
404720.872693
405640.875682
406540.878568
407450.88145



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