DM_TwoAssetCorrelation





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

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

Key TAGs | Excel Index | API Index



One asset decides if the option is in or out of the money, another asset with its own strike decides the payoff.

For a call the payoff is max(S2-X2) if S1 is greater than X1 and 0 otherwise, for a put the payoff is max(X2-S2) if S1 is less than X1 and 0 otherwise.

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_TwoAssetCorrelation




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

    Option Types (C)all or (P)ut
  4. Underlying1 parameter

    Price of the first underlying
  5. Underlying2 parameter

    Price of the second underlying
  6. Strike1 parameter

    Strike price of underlying Price1.
  7. Strike2 parameter

    Strike price of underlying Price2.
  8. Time parameter

    Expiration date of the option.
  9. 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.
  10. 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.
  11. 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.
  12. Vol1 parameter

    Volatility of the underlying Price1.
  13. Vol2 parameter

    Volatility of the underlying Price2.
  14. Rho parameter

    Correlation between the two assets.


Extended information

Function Syntax

VB Syntax


Variant CTDerivativeMatrix.DM_TwoAssetCorrelation( _
Long ValueDate, _
DayCountEnum dayCounter, _
String CallPut, _
Double Underlying1, _
Double Underlying2, _
Double Strike1, _
Double Strike2, _
Long Time, _
Double b1, _
Double b2, _
Double Rate, _
Double Vol1, _
Double Vol2, _
Double Rho)


Excel Spreadsheet Syntax


=CT.DM_TwoAssetCorrelation(
Excel Numeric Cell ValueDate,
Excel String Cell dayCounter,
Excel String Cell CallPut,
Excel Numeric Cell Underlying1,
Excel Numeric Cell Underlying2,
Excel Numeric Cell Strike1,
Excel Numeric Cell Strike2,
Excel Numeric Cell Time,
Excel Numeric Cell b1,
Excel Numeric Cell b2,
Excel Numeric Cell Rate,
Excel Numeric Cell Vol1,
Excel Numeric Cell Vol2,
Excel Numeric Cell Rho)


C++ Syntax


static CTRangeDataCPP DM_TwoAssetCorrelation(
long ValueDate,
DayCountEnum dayCounter,
std::string CallPut,
double Underlying1,
double Underlying2,
double Strike1,
double Strike2,
long Time,
double b1,
double b2,
double Rate,
double Vol1,
double Vol2,
double Rho);


DotNET Syntax


CTRangeData CTDerivativeMatrixSA.DM_TwoAssetCorrelation(
System.Int32 ValueDate,
CTIEnums.DayCountEnum dayCounter,
System.String CallPut,
System.Double Underlying1,
System.Double Underlying2,
System.Double Strike1,
System.Double Strike2,
System.Int32 Time,
System.Double b1,
System.Double b2,
System.Double Rate,
System.Double Vol1,
System.Double Vol2,
System.Double Rho);

Parameter data types

ArgNameArgTypeIsKey
ValueDateLongFALSE
dayCounterDayCountEnumFALSE
CallPutStringFALSE
Underlying1DoubleFALSE
Underlying2DoubleFALSE
Strike1DoubleFALSE
Strike2DoubleFALSE
TimeLongFALSE
b1DoubleFALSE
b2DoubleFALSE
RateDoubleFALSE
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
CallPutFALSECall
Underlying1FALSE52
Underlying2FALSE65
Strike1FALSE50
Strike2FALSE70
TimeFALSE17/Jan/2006 (serial date type)
b1FALSE0.00
b2FALSE0.00
RateFALSE0.1
Vol1FALSE0.2
Vol2FALSE0.3
RhoFALSE0.75


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


Example
DUNDERLYING1DUNDERLYING2DSTRIKE1DSTRIKE2DTIMEDB1DB2DRATEDVOL1DVOL2DRHO
DUNDERLYING1-0.01592980.008547990.0157484-0.00735270.05470960.392632-0.277049-0.1359920.1853430.148966-0.270062
DUNDERLYING20.008547990.0250411-0.00888991-0.02325240.249242-0.221639-1.048431.03324-0.220150.2864660.145157
DSTRIKE10.0157484-0.00888991-0.0155270.00764681-0.056898-0.4083370.288130.141432-0.192756-0.1549240.280865
DSTRIKE2-0.0073527-0.02325240.007646810.0215916-0.1167790.1906460.753634-0.7578210.189366-0.00922667-0.12244
DTIME0.05470960.249242-0.056898-0.116779-4.35225-3.54694-38.950533.799-2.6860618.29811.79965
DB10.392632-0.221639-0.4083370.190646-3.54694-10.18057.183533.52611-4.80571-3.862497.00238
DB2-0.277049-1.048430.288130.753634-38.95057.1835333.9808-33.48857.13529-9.28464-4.70468
DRATE-0.1359921.033240.141432-0.75782133.7993.52611-33.488522.925-1.803954.18454-2.72871
DVOL10.185343-0.22015-0.1927560.189366-2.68606-4.805717.13529-1.80395-0.56396-3.836566.95535
DVOL20.1489660.286466-0.154924-0.0092266718.2981-3.86249-9.284644.18454-3.836560.6798533.16464
DRHO-0.2700620.1451570.280865-0.122441.799657.00238-4.70468-2.728716.955353.16464-3.43082



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