DM_ComplexChooser





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

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

Key TAGs | Excel Index | API Index



Option that gives the holder the right to choose between a call option after time t1, with time to expiration Tc and strike Xc or a put option after time t1 with time to maturity Tp and strike Xp.

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_ComplexChooser




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

    Underlying price, curve
  4. StrikeC parameter

    Strike price of the call option.
  5. StrikeP parameter

    Strike price of the put option.
  6. Timet1 parameter

    Time at which the option choices will be decided.
  7. TimeC parameter

    Expiration date of the call option.
  8. TimeP parameter

    Expiration date of the put option.
  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. B parameter

    For the 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. Vol parameter

    Volatility of the underlying.


Extended information

Function Syntax

VB Syntax


Variant CTDerivativeMatrix.DM_ComplexChooser( _
Long ValueDate, _
DayCountEnum dayCounter, _
Double Underlying, _
Double StrikeC, _
Double StrikeP, _
Long Timet1, _
Long TimeC, _
Long TimeP, _
Double Rate, _
Double B, _
Double Vol)


Excel Spreadsheet Syntax


=CT.DM_ComplexChooser(
Excel Numeric Cell ValueDate,
Excel String Cell dayCounter,
Excel Numeric Cell Underlying,
Excel Numeric Cell StrikeC,
Excel Numeric Cell StrikeP,
Excel Numeric Cell Timet1,
Excel Numeric Cell TimeC,
Excel Numeric Cell TimeP,
Excel Numeric Cell Rate,
Excel Numeric Cell B,
Excel Numeric Cell Vol)


C++ Syntax


static CTRangeDataCPP DM_ComplexChooser(
long ValueDate,
DayCountEnum dayCounter,
double Underlying,
double StrikeC,
double StrikeP,
long Timet1,
long TimeC,
long TimeP,
double Rate,
double B,
double Vol);


DotNET Syntax


CTRangeData CTDerivativeMatrixSA.DM_ComplexChooser(
System.Int32 ValueDate,
CTIEnums.DayCountEnum dayCounter,
System.Double Underlying,
System.Double StrikeC,
System.Double StrikeP,
System.Int32 Timet1,
System.Int32 TimeC,
System.Int32 TimeP,
System.Double Rate,
System.Double B,
System.Double Vol);

Parameter data types

ArgNameArgTypeIsKey
ValueDateLongFALSE
dayCounterDayCountEnumFALSE
UnderlyingDoubleFALSE
StrikeCDoubleFALSE
StrikePDoubleFALSE
Timet1LongFALSE
TimeCLongFALSE
TimePLongFALSE
RateDoubleFALSE
BDoubleFALSE
VolDoubleFALSE


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
UnderlyingFALSE50
StrikeCFALSE55
StrikePFALSE48
Timet1FALSE18/Oct/2005 (serial date type)
TimeCFALSE17/Jan/2006 (serial date type)
TimePFALSE17/Feb/2006 (serial date type)
RateFALSE0.1
BFALSE0.05
VolFALSE0.35


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


Example
DUNDERLYINGDSTRIKECDSTRIKEPDTIMET1DTIMECDTIMEPDRATEDBDVOL
DUNDERLYING0.0660709-0.0307025-0.0336440.07925050.304316-0.06079131.7844-1.789730.268973
DSTRIKEC-0.03070250.02141650.00744198-0.236629-0.06401550.087324-0.6697740.791948-0.0718639
DSTRIKEP-0.0336440.007441980.02651860.288909-0.174629-0.00406567-1.145140.9424870.285553
DTIMET10.0792505-0.2366290.288909-12.87252.03680.851677-1.60316-0.99865319.0236
DTIMEC0.304316-0.0640155-0.1746292.0368-1.29591-2.0490920.5478-25.07886.73023
DTIMEP-0.06079130.087324-0.004065670.851677-2.04909-1.68514-18.586914.54625.18114
DRATE1.7844-0.669774-1.14514-1.6031620.5478-18.586950.4449-48.1189-6.02776
DB-1.789730.7919480.942487-0.998653-25.078814.5462-48.118947.5802-6.52774
DVOL0.268973-0.07186390.28555319.02366.730235.18114-6.02776-6.527742.57209



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