DM_ExchangeExchangeOption





http://www.QuantTools.com
CapeTools Derivative Matrix function list

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

Key TAGs | Excel Index | API Index



Exchange options on Exchange Options.

1=Option to exchange Q*S2 for the option to exchange S2 for S1, 2=Option to exchange the option to exchange S2 for S1 in return for Q*S2, 3=Option to exchange Q*S2 for the option to exchange S1 for S2, 4=Option to exchange the option to exchange S1 for S2 in return for Q*S2 . 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 returns a partial derivative matrix of all second order derivatives (Hessian matrix).

Each individual second order derivative as well as the first order derivatives can be obtained, individually, via the pricing functions present within the CapeTools Exotic Options category of functions.

However this function computes all the second order risk numbers in a single function call.



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




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

    Integer value (1 - 4) indicating option type.
  4. Underlying1 parameter

    Price of the first underlying
  5. Underlying2 parameter

    Price of the second underlying
  6. Q parameter

    Quantity of the second underlying S2.
  7. Timet1 parameter

    Time to expiration of the original option.
  8. TimeT parameter

    Time to expiration of the underlying option, (greater than dTimet1).
  9. Rate parameter

    For the underlying (equity, futures, FX or commodity), this should be an annualised rate (risk free rate or foreign rate). If this is an option on a FX underlying, then if the underlying is quoted as domestic/foreign then this rate will be the domestic rate. If, however, the FX underlying is quoted as foreign/domestic then this will be the foreign rate.
  10. b1 parameter

    For the first underlying (equity, futures, FX or commodity), this should be an annualised rate (dividend rate, risk free rate, foreign rate or holding cost rate respectively). If this is an option on a FX underlying, then if the underlying is quoted as domestic/foreign then this rate will be the foreign rate. If, however, the FX underlying is quoted as foreign/domestic then this will be the domestic rate.
  11. b2 parameter

    For the second underlying (equity, futures, FX or commodity), this should be an annualised rate (dividend rate, risk free rate, foreign rate or holding cost rate respectively). If this is an option on a FX underlying, then if the underlying is quoted as domestic/foreign then this rate will be the foreign rate. If, however, the FX underlying is quoted as foreign/domestic then this will be the domestic rate.
  12. Vol1 parameter

    Volatility of the underlying UnderlyingS1.
  13. Vol2 parameter

    Volatility of the underlying UnderlyingS2.
  14. Rho parameter

    Correlation between the two assets.


Extended information

Function Syntax

VB Syntax


Variant CTDerivativeMatrix.DM_ExchangeExchangeOption( _
Long ValueDate, _
DayCountEnum dayCounter, _
Long OptionType, _
Double Underlying1, _
Double Underlying2, _
Double Q, _
Long Timet1, _
Long TimeT, _
Double Rate, _
Double b1, _
Double b2, _
Double Vol1, _
Double Vol2, _
Double Rho)


Excel Spreadsheet Syntax


=CT.DM_ExchangeExchangeOption(
Excel Numeric Cell ValueDate,
Excel String Cell dayCounter,
Excel Numeric Cell OptionType,
Excel Numeric Cell Underlying1,
Excel Numeric Cell Underlying2,
Excel Numeric Cell Q,
Excel Numeric Cell Timet1,
Excel Numeric Cell TimeT,
Excel Numeric Cell Rate,
Excel Numeric Cell b1,
Excel Numeric Cell b2,
Excel Numeric Cell Vol1,
Excel Numeric Cell Vol2,
Excel Numeric Cell Rho)


C++ Syntax


static CTRangeDataCPP DM_ExchangeExchangeOption(
long ValueDate,
DayCountEnum dayCounter,
long OptionType,
double Underlying1,
double Underlying2,
double Q,
long Timet1,
long TimeT,
double Rate,
double b1,
double b2,
double Vol1,
double Vol2,
double Rho);


DotNET Syntax


CTRangeData CTDerivativeMatrixSA.DM_ExchangeExchangeOption(
System.Int32 ValueDate,
CTIEnums.DayCountEnum dayCounter,
System.Int32 OptionType,
System.Double Underlying1,
System.Double Underlying2,
System.Double Q,
System.Int32 Timet1,
System.Int32 TimeT,
System.Double Rate,
System.Double b1,
System.Double b2,
System.Double Vol1,
System.Double Vol2,
System.Double Rho);

Parameter data types

ArgNameArgTypeIsKey
ValueDateLongFALSE
dayCounterDayCountEnumFALSE
OptionTypeLongFALSE
Underlying1DoubleFALSE
Underlying2DoubleFALSE
QDoubleFALSE
Timet1LongFALSE
TimeTLongFALSE
RateDoubleFALSE
b1DoubleFALSE
b2DoubleFALSE
Vol1DoubleFALSE
Vol2DoubleFALSE
RhoDoubleFALSE


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
OptionTypeFALSE2
Underlying1FALSE105
Underlying2FALSE100
QFALSE0.1
Timet1FALSE19/Apr/2006 (serial date type)
TimeTFALSE19/Jul/2006 (serial date type)
RateFALSE0.1
b1FALSE0.00
b2FALSE0.00
Vol1FALSE0.2
Vol2FALSE0.25
RhoFALSE0.5


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


Example
DUNDERLYING1DUNDERLYING2DQDTIMET1DTIMETDRATEDB1DB2DVOL1DVOL2DRHO
DUNDERLYING10.00298404-0.00313324-1.853860.05225460.04855210-0.1350630.2672470.2507970.501594-0.167198
DUNDERLYING2-0.003133240.003289912.54704-0.0120446-0.085181400.329163-0.49618-0.269209-0.5384170.179472
DQ-1.853862.54704232.13715.8802-17.32640194.667-233.956-15.444-30.887910.296
DTIMET10.0522546-0.012044615.88020.50203-3.313680-5.48598-4.405253.844177.68834-2.56278
DTIMET0.0485521-0.0851814-17.3264-3.313684.95491013.636-8.96248-2.72223-5.444451.81482
DRATE00000000000
DB1-0.1350630.329163194.667-5.4859813.63604.00375-19.0962-26.3341-52.668217.5561
DB20.267247-0.49618-233.956-4.40525-8.962480-19.096235.887326.536253.0725-17.6908
DVOL10.250797-0.269209-15.4443.84417-2.722230-26.334126.5362-5.684528.204730.527386
DVOL20.501594-0.538417-30.88797.68834-5.444450-52.668253.07258.204730.750441-1.29408
DRHO-0.1671980.17947210.296-2.562781.81482017.5561-17.69080.527386-1.294080.953328



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