Four types of two-asset cash-or-nothing options exist : A two-asset cash-or-nothing call pays out a fixed cash amount K if asset one, S1 is above the strike X1 and asset two, S2, is above strike X2 at expiration (TypeFlag=1).
A two-asset cash-or-nothing put pays out a fixed cash amount if asset one, S1, is below the strike X1 and asset two, S2 is below strike X2 at expiration (TypeFlag=2).
A two-asset cash-or-nothing up-down pays out a fixed cash amount if asset one S1, is above the strike X1 and asset two, S2, is below the strike X2 at expiration (TypeFlag=3).
Finally a two-asset cash-or-nothing down-up pays out a fixed cash amount if asset one, s1, is below the strike x1 and asset two, s2, is above strike X2 at expiration (TypeFlag=4).
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 stores a portfolio of equity, commodities, futures or FX options in memory and returns a key.
This allows you to price or query the portfolio for different value dates via just the portfolio key.
You can price the portfolio via the
PriceOptionBook() function.
You can view the trades within the portfolio via the
DisplayOptionBook() function.
The
DisplayOptionBook() function allows you to sort the portfolio using any column (or combination of columns).
A column is simply the NAME of any of the parameters within this function (excluding the 'TradeKey' and 'Reload' parameters).
In addition you can create a new portfolio object from this object by grouping trades within the portfolio, for example by Currency, Units, Sector etc..., using the
GroupOptionBook() function.
You simply provide the NAME of the parameters that you wish to group.
Groups can represent more than one column and thus enables you to price a portion of the portfolio (a group) using the same
PriceOptionBook() function.
You can view the grouped names within the grouped portfolio via the
DisplayOptionGroups() function.
You can view the trades within a group via the
DisplayGRPOptionBook() function.
Furthermore you can create a new portfolio from this portfolio object by selecting a portion of the trades (via a sql-like language).
Again this portfolio can be priced via the
PriceOptionBook() function.
You can also execute the
WriteXLRange(),
WriteXLRange2() or
WriteXLRange3() and the corresponding
ReadXLRange(),
ReadXLRange2() or
ReadXLRange3() functions in order to read and write the portfolio data to file (XML).
WriteXLRange2() is preferable as you can save each of the ranges of this function to different slots (total of 15) within the XML file.
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 : "TwoAssetCashOrNothing"
- TradeKey parameter
User Handle used to retrieve the object
- Reload parameter
When creating this object for the first time, set this parameter to a positive value. Within Excel, when recomputing a worksheet where you do not wish to recreate the object, set this parameter to zero (0).
- ID parameter
Identifier of deal. Used in order to index within the portfolio.
- TAG parameter
User defined Tag. The information within this column can be used within the 'CapeTools Select Sub-Portfolios' or 'CapeTools Group Sub-Portfolios' categories of functions.
- Ccy parameter
Currency of the portfolio.
- Units parameter
Number of option contracts you wish to trade in (positive value).
- Position parameter
Whether you are long or short the option.
- TypeFlag parameter
Integer value (1 - 4) indicating option type.
- S1 parameter
Price of the first underlying
- S2 parameter
Price of the second underlying
- X1 parameter
Strike price of the first underlying.
- X2 parameter
Strike price of the second underlying.
- K parameter
Cash amount to be paid out.
- T parameter
Time to option maturity.
- r 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.
- 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.
- 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.
- Vol1 parameter
Volatility of the first underlying.
- Vol2 parameter
Volatility of the second underlying.
- Rho parameter
Correlation between the two assets.
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.
Copyright (c) 2003-2007 CapeTools - All Rights Reserved.