RSKEquityLinkedFXO





http://www.QuantTools.com
CapeTools Bump Risk function list

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

Key TAGs | Excel Index | API Index



In an equity-linked foreign-exchange option, the quantity of the face value will be linked to the level of the forward price of a stock or equity index.

this is an ideal option for an investor who wants to speculate directly in a foreign equity market but wishes to place a floor on the currency exposure.

This function utilizes an analytical (closed-form) algorithm.

Note that the risk (greek) numbers produced are the mathematically defined equivalent of a derivative (instantaneous change).

You can convert the risk number to your own definition of risk by multiplying by the shift you require.

For example, for a typical definition of VANNA, (change in underlying and volatility), where one defines the change in the underlying as a single unit of change (1.0) and the change in volatility as a one percent change (0.01), simply multiply the VANNA result calculated by (1.0*0.01).

For VEGA, change in volatility of one percent (0.01), simply multiply the VEGA result by 0.01. Within option contracts THETA is negative, however the mathematically defined equivalent of THETA (instantaneous FORWARD change in time) is positive.

Internally we have negated this value for you.

To express THETA as THETA per day, simply multiply the THETA result by 1/365 or 1/252 (depending on whether you require calendar days or business days).

This function bumps an input parameter given a bump map and displays the difference from the base value.

You can request to see the difference of any of the option greeks.

The name of the parameter that you wish to bump is simply entered into the 'BumpParam' string parameter.

The bump map can be a single value, a vector or a matrix input.



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




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

    For any input parameter within this function that represents a dividend rate, risk free rate, foreign rate or holding cost rate, these rates will be defined as annually compounded using the DayCounter defined within this parameter. Thus if 'actual365' is used for this 'dayCounter' parameter, then all input parameters that represent a dividend, risk free, foreign or holding cost rates will be defined as annually compounded Actual365 rates.
  3. BumpRange parameter

    A range of bump values, of which the chosen input will be bumped by. For Equity, FX type deals, you can provide a single value, vector or matrix, for interest rate type products, the bump range must be of the same shape as the market curve.
  4. BumpParam parameter

    The parameter in which will be bumped, you can only choose parameters in which the ranges normally take double (decimal) values.
  5. CallPut parameter

    Option Types (C)all or (P)ut
  6. E parameter

    Spot exchange rate specified in units of domestic currency per unit of foreign currency.
  7. S parameter

    Underlying price in foreign currency
  8. X parameter

    Currency strike price in domestic currency
  9. T parameter

    Time to option maturity.
  10. r parameter

    Domestic interest rate
  11. rf parameter

    Foreign interest rate.
  12. q parameter

    Instantaneous proportional dividend payout rate of the underlying asset
  13. vS parameter

    Volatility of the underlying asset.
  14. vE parameter

    Volatility of the domestic exchange rate.
  15. rho parameter

    Correlation between the asset and the domestic exchange rate.
  16. Greek parameter

    For the option premium specify 'PREMIUM'. For all first derivatives, you can specify one of the following : 'dE' (for the 'E' parameter), 'dS' (for the 'S' parameter), 'dX' (for the 'X' parameter), 'dT' (for the 'T' parameter), 'dr' (for the 'r' parameter), 'drf' (for the 'rf' parameter), 'dq' (for the 'q' parameter), 'dvS' (for the 'vS' parameter), 'dvE' (for the 'vE' parameter), 'drho' (for the 'rho' parameter), For second order derivatives, you can specify combinations of the first order derivatives (i.e. - 'dSdS', 'dvSdvS', 'dSdvS'. )


Extended information

Function Syntax

VB Syntax


Variant CTBumpRisk.RSKEquityLinkedFXO( _
Long ValueDate, _
DayCountEnum dayCounter, _
Variant BumpRange, _
String BumpParam, _
Variant CallPut, _
Variant E, _
Variant S, _
Variant X, _
Variant T, _
Variant r, _
Variant rf, _
Variant q, _
Variant vS, _
Variant vE, _
Variant rho, _
String Greek)


Excel Spreadsheet Syntax


=CT.RSKEquityLinkedFXO(
Excel Numeric Cell ValueDate,
Excel String Cell dayCounter,
XLRange BumpRange,
Excel String Cell BumpParam,
XLRange CallPut,
XLRange E,
XLRange S,
XLRange X,
XLRange T,
XLRange r,
XLRange rf,
XLRange q,
XLRange vS,
XLRange vE,
XLRange rho,
Excel String Cell Greek)


C++ Syntax


static CTRangeDataCPP RSKEquityLinkedFXO(
long ValueDate,
DayCountEnum dayCounter,
CTRangeDataCPP BumpRange,
std::string BumpParam,
CTRangeDataCPP CallPut,
CTRangeDataCPP E,
CTRangeDataCPP S,
CTRangeDataCPP X,
CTRangeDataCPP T,
CTRangeDataCPP r,
CTRangeDataCPP rf,
CTRangeDataCPP q,
CTRangeDataCPP vS,
CTRangeDataCPP vE,
CTRangeDataCPP rho,
std::string Greek);


DotNET Syntax


CTRangeData CTBumpRiskSA.RSKEquityLinkedFXO(
System.Int32 ValueDate,
CTIEnums.DayCountEnum dayCounter,
CTRangeData BumpRange,
System.String BumpParam,
CTRangeData CallPut,
CTRangeData E,
CTRangeData S,
CTRangeData X,
CTRangeData T,
CTRangeData r,
CTRangeData rf,
CTRangeData q,
CTRangeData vS,
CTRangeData vE,
CTRangeData rho,
System.String Greek);

Parameter data types

ArgNameArgTypeIsKey
ValueDateLongFALSE
dayCounterDayCountEnumFALSE
BumpRangeRangeFALSE
BumpParamStringFALSE
CallPutRangeFALSE
ERangeFALSE
SRangeFALSE
XRangeFALSE
TRangeFALSE
rRangeFALSE
rfRangeFALSE
qRangeFALSE
vSRangeFALSE
vERangeFALSE
rhoRangeFALSE
GreekStringFALSE


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)
dayCounterFALSEACT365
BumpRangeFALSERSKEquityLinkedFXO_BumpRange_Range (creates a range object)
BumpParamFALSEvS
CallPutFALSERSKEquityLinkedFXO_CallPut_Range (creates a range object)
EFALSERSKEquityLinkedFXO_E_Range (creates a range object)
SFALSERSKEquityLinkedFXO_S_Range (creates a range object)
XFALSERSKEquityLinkedFXO_X_Range (creates a range object)
TFALSERSKEquityLinkedFXO_T_Range (creates a range object)
rFALSERSKEquityLinkedFXO_r_Range (creates a range object)
rfFALSERSKEquityLinkedFXO_rf_Range (creates a range object)
qFALSERSKEquityLinkedFXO_q_Range (creates a range object)
vSFALSERSKEquityLinkedFXO_vS_Range (creates a range object)
vEFALSERSKEquityLinkedFXO_vE_Range (creates a range object)
rhoFALSERSKEquityLinkedFXO_rho_Range (creates a range object)
GreekFALSEPREMIUM


Example range for parameter : BumpRange

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


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

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



CTQL.CTRangeData RSKEquityLinkedFXO_BumpRange;


double[] arrBRSKEquityLinkedFXO_BumpRange = {
0.0193,
0.0185,
0.0206,
0.0181,
0.0218,
0.0192,
0.0189,
0.019,
0.0212,
0.0196,
0.0189,
0.0206,
0.0201,
0.0202,
0.0181,
0.021,
0.0219,
0.0193,
0.0209,
0.02  //  Array Data

};

CTQL.DoubleVector arrRSKEquityLinkedFXO_BumpRange =
new  CTQL.DoubleVector(arrBRSKEquityLinkedFXO_BumpRange);

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


Example range for parameter : CallPut

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


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

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



CTQL.CTRangeData RSKEquityLinkedFXO_CallPut;


string[] arrBRSKEquityLinkedFXO_CallPut = {
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call"  //  Array Data

};

CTQL.StringVector arrRSKEquityLinkedFXO_CallPut =
new  CTQL.StringVector(arrBRSKEquityLinkedFXO_CallPut);

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


Example range for parameter : E

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


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

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



CTQL.CTRangeData RSKEquityLinkedFXO_E;


double[] arrBRSKEquityLinkedFXO_E = {
1.6264,
1.5136,
1.445,
1.5025,
1.3812,
1.5727,
1.5721,
1.4838,
1.6248,
1.5541,
1.366,
1.4627,
1.5818,
1.4778,
1.3856,
1.5059,
1.52,
1.534,
1.3794,
1.5  //  Array Data

};

CTQL.DoubleVector arrRSKEquityLinkedFXO_E =
new  CTQL.DoubleVector(arrBRSKEquityLinkedFXO_E);

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


Example range for parameter : S

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


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

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



CTQL.CTRangeData RSKEquityLinkedFXO_S;


double[] arrBRSKEquityLinkedFXO_S = {
107.0268,
101.6977,
100.4228,
99.7833,
103.8442,
98.9845,
90.3446,
109.6714,
100.2202,
96.7365,
101.449,
108.2771,
93.6461,
93.7293,
103.6591,
107.0813,
105.9298,
95.7893,
105.7458,
100.0  //  Array Data

};

CTQL.DoubleVector arrRSKEquityLinkedFXO_S =
new  CTQL.DoubleVector(arrBRSKEquityLinkedFXO_S);

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


Example range for parameter : X

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


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

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



CTQL.CTRangeData RSKEquityLinkedFXO_X;


double[] arrBRSKEquityLinkedFXO_X = {
1.5764,
1.5219,
1.5345,
1.6263,
1.6274,
1.5355,
1.3738,
1.6318,
1.5962,
1.4455,
1.6631,
1.3909,
1.4266,
1.6673,
1.6307,
1.489,
1.5092,
1.58,
1.4864,
1.52  //  Array Data

};

CTQL.DoubleVector arrRSKEquityLinkedFXO_X =
new  CTQL.DoubleVector(arrBRSKEquityLinkedFXO_X);

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


Example range for parameter : T

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


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

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



CTQL.CTRangeData RSKEquityLinkedFXO_T;


int[] arrBRSKEquityLinkedFXO_T = {
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy")  //  Array Data

};

CTQL.IntVector arrRSKEquityLinkedFXO_T =
new  CTQL.IntVector(arrBRSKEquityLinkedFXO_T);

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


Example range for parameter : r

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


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

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



CTQL.CTRangeData RSKEquityLinkedFXO_r;


double[] arrBRSKEquityLinkedFXO_r = {
0.075,
0.073,
0.0878,
0.0764,
0.074,
0.082,
0.0789,
0.0845,
0.0782,
0.0842,
0.0803,
0.0766,
0.0845,
0.0737,
0.074,
0.0844,
0.0826,
0.0827,
0.0731,
0.08  //  Array Data

};

CTQL.DoubleVector arrRSKEquityLinkedFXO_r =
new  CTQL.DoubleVector(arrBRSKEquityLinkedFXO_r);

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


Example range for parameter : rf

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


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

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



CTQL.CTRangeData RSKEquityLinkedFXO_rf;


double[] arrBRSKEquityLinkedFXO_rf = {
0.0538,
0.0474,
0.048,
0.0464,
0.0474,
0.0544,
0.0453,
0.0517,
0.0521,
0.0517,
0.0523,
0.0465,
0.0525,
0.0479,
0.0538,
0.0545,
0.0539,
0.0508,
0.0469,
0.05  //  Array Data

};

CTQL.DoubleVector arrRSKEquityLinkedFXO_rf =
new  CTQL.DoubleVector(arrBRSKEquityLinkedFXO_rf);

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


Example range for parameter : q

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


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

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



CTQL.CTRangeData RSKEquityLinkedFXO_q;


double[] arrBRSKEquityLinkedFXO_q = {
0.0395,
0.0373,
0.0401,
0.0369,
0.0425,
0.0434,
0.0431,
0.0383,
0.0409,
0.0421,
0.0425,
0.039,
0.044,
0.0427,
0.0375,
0.0418,
0.0424,
0.0373,
0.0378,
0.04  //  Array Data

};

CTQL.DoubleVector arrRSKEquityLinkedFXO_q =
new  CTQL.DoubleVector(arrBRSKEquityLinkedFXO_q);

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


Example range for parameter : vS

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


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

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



CTQL.CTRangeData RSKEquityLinkedFXO_vS;


double[] arrBRSKEquityLinkedFXO_vS = {
0.2106,
0.1925,
0.2102,
0.1841,
0.1887,
0.2135,
0.2106,
0.2027,
0.204,
0.2045,
0.2169,
0.216,
0.1972,
0.2158,
0.1805,
0.1827,
0.2146,
0.1808,
0.2036,
0.20  //  Array Data

};

CTQL.DoubleVector arrRSKEquityLinkedFXO_vS =
new  CTQL.DoubleVector(arrBRSKEquityLinkedFXO_vS);

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


Example range for parameter : vE

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


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

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



CTQL.CTRangeData RSKEquityLinkedFXO_vE;


double[] arrBRSKEquityLinkedFXO_vE = {
0.1269,
0.1209,
0.1202,
0.1231,
0.1105,
0.1163,
0.1096,
0.1141,
0.1216,
0.1129,
0.108,
0.1116,
0.1088,
0.1223,
0.1246,
0.1258,
0.1207,
0.1204,
0.131,
0.12  //  Array Data

};

CTQL.DoubleVector arrRSKEquityLinkedFXO_vE =
new  CTQL.DoubleVector(arrBRSKEquityLinkedFXO_vE);

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


Example range for parameter : rho

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


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

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



CTQL.CTRangeData RSKEquityLinkedFXO_rho;


double[] arrBRSKEquityLinkedFXO_rho = {
-0.4275,
-0.3726,
-0.427,
-0.3896,
-0.4201,
-0.4088,
-0.3764,
-0.3874,
-0.4284,
-0.3983,
-0.385,
-0.3704,
-0.3929,
-0.3844,
-0.408,
-0.378,
-0.4,
-0.3731,
-0.4319,
-0.4  //  Array Data

};

CTQL.DoubleVector arrRSKEquityLinkedFXO_rho =
new  CTQL.DoubleVector(arrBRSKEquityLinkedFXO_rho);

// Second parameter determines whether the array is a column array (false) or a row array (true)
RSKEquityLinkedFXO_rho = new  CTQL.CTRangeData(arrRSKEquityLinkedFXO_rho, 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.Pricing20 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 RSKEquityLinkedFXO() 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 RSKEquityLinkedFXO() function call


Example
-0.0291645
-0.0497677
-0.0532875
-0.0186414
-0.00647926
-0.0076844
-0.0120395
-0.0632401
-0.0296003
-0.0596568
-0.036899
-0.00414834
-0.0373645
-0.0226035
-0.00302997
-0.0572365
-0.0551489
-0.0219382
-0.0414933
-0.033019



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