CreateFXManager





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

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

Key TAGs | Excel Index | API Index



Loads a FX table from a range object into a Exchange Rate Manager object.

A key will be returned which will represent a handle to the created FXManager object.

The FX range table read in consists of a 3 column range of FX information (FXCCY1, FXCCY2, FXValue).

Thus the first column represents the first currency, the second column the second currency and the third column is the FXRate between the two currencies.

You can use this object within the 'Money' group of functions in order to convert monies from one currency to another.

FX chains between individual FXRates are automatically created within the FXManager so if yo have already defined an FXRate between GBP/USD and an FXRate between JPY/USD then the FXRate between GBP/JPY can automatically be computed and thus does not need to be defined.

You can view this FXManager object as a collection of individual FX (Exchange) rate objects (which can be created via the CreateFX() function).

There are 11 predefined FXRates values (determined as of : 1,January,1999).

These are : EUR/ATS=13.7603, EUR/BEF=40.3399, EUR/DEM=1.95583, EUR/ESP=166.386, EUR/FIM=5.94573, EUR/FRF=6.55957, EUR/IEP=0.787564, EUR/ITL=1936.27, EUR/LUF=40.3399, EUR/NLG=2.20371 and EUR/PTE=200.482. There are three further predefined exchange rates.

These are : EUR/GRD=340.750 (1,January,2001), TRY/TRL=1000000.0 (1,January,2005) and RON/ROL=10000.0 (1,July,2005).



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



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




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



Parameter Description


  1. FXKey parameter

    Key that will be associated with this new object (the key will be used internally to keep track of this 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. FXRange parameter

    A 3 column range of FX information ( FX1, FX2, FXValue ).


Extended information

Function Syntax

VB Syntax


String CTCurrency.CreateFXManager( _
String FXKey, _
Long Reload, _
Variant FXRange)


Excel Spreadsheet Syntax


=CT.FX.CreateFXManager(
Excel String Cell FXKey,
Excel Numeric Cell Reload,
XLRange FXRange)


C++ Syntax


static std::string CreateFXManager(
std::string FXKey,
long Reload,
CTRangeDataCPP FXRange);


DotNET Syntax


System.String CTCurrencySA.CreateFXManager(
System.String FXKey,
System.Int32 Reload,
CTRangeData FXRange);

Parameter data types

ArgNameArgTypeIsKey
FXKeyStringFALSE
ReloadLongFALSE
FXRangeRangeFALSE


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
FXKeyFALSEMyFXManager
ReloadFALSE1
FXRangeTRUECreateFXManager_FXRange_Range (creates a range object)


Example range for parameter : FXRange

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

EURGBP1.56
EURUSD1.3
JPYGBP100.5
EURCHF1.6
DKKGBP35.35

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



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

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

CreateFXManager_FXRange_builder.Append("{");
CreateFXManager_FXRange_builder.Append("'EUR'	 | 'GBP'	 | 1.56 ;");
CreateFXManager_FXRange_builder.Append("'EUR'	 | 'USD'	 | 1.3 ;");
CreateFXManager_FXRange_builder.Append("'JPY'	 | 'GBP'	 | 100.5 ;");
CreateFXManager_FXRange_builder.Append("'EUR'	 | 'CHF'	 | 1.6 ;");
CreateFXManager_FXRange_builder.Append("'DKK'	 | 'GBP'	 | 35.35");
CreateFXManager_FXRange_builder.Append("}");

// Parse the string into the Range object.
CreateFXManager_FXRange.RangeFromStr( CreateFXManager_FXRange_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 CreateFXManager() 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 CreateFXManager() function call


MyFXManager_5.FXLR.0

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