Documentation/Calc Functions/OPT TOUCH
TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate
Function name:
OPT_TOUCH
Category:
Financial Analysis
Summary:
Calculates the pricing for a touch/no-touch option using the Black-Scholes pricing model.
Syntax:
OPT_TOUCH(Spot; Volatility; Rate; Foreign rate; Maturity; Lower barrier; Upper barrier; Foreign/Domestic; Knock-In/Out; Barrier type[; Greek])
Returns:
Returns a real number which is the pricing for an option with the specified characteristics. The number returned is in the same currency unit as relevant arguments, such as the spot price and barrier levels.
Arguments:
Spot is a positive real number, or a reference to a cell containing that number, which is the current market price of the underlying asset.
Volatility is a positive real number (expressed as a percentage, such as 2.5%, or a decimal fraction, such as 0.025), or a reference to a cell containing that number, which is the estimated annual volatility of the underlying asset.
Rate is a real number (expressed as a percentage, such as 2.5%, or a decimal fraction, such as 0.025), or a reference to a cell containing that number, which is the continuously compounded annual risk-free interest rate.
Foreign rate is a real number (expressed as a percentage, such as 2.5%, or a decimal fraction, such as 0.025), or a reference to a cell containing that number, which is the continuously compounded annual foreign interest rate.
Maturity is a non-negative real number, or a reference to a cell containing that number, which is the time to maturity of the option in years.
Lower barrier is a real number, or a reference to a cell containing that number, which is the predetermined lower barrier price. This should be set to zero for no lower barrier.
Upper barrier is a real number, or a reference to a cell containing that number, which is the predetermined upper barrier price. This should be set to zero for no upper barrier.
Foreign/Domestic is a string, or a reference to a cell containing that string, which specifies whether the option pays domestic (any string that begins with a lowercase "d") or foreign (any string that begins with a lowercase "f") currency.
Knock-In/Out is a string, or a reference to a cell containing that string, which specifies whether the option is a knock-in (any string that begins with a lowercase "i") or a knock-out (any string that begins with a lowercase "o").
Barrier type is a string, or a reference to a cell containing that string, which specifies whether the barrier is monitored continuously (lowercase "c") or only at the end/maturity (lowercase "e").
Greek is a string of lowercase characters, or a reference to a cell containing that string, which determines which of the available "Greeks" should be used. A Greek is a measure of how the option price changes as a parameter in the Black-Scholes model is changed. The following table lists the available options.
String | Description |
---|---|
"value" or "v" or "price" or "p" | OPT_TOUCH simply returns the option price. This is the default that is applied if the Greek argument is omitted. |
"delta" or "d" | Represents the sensitivity of the option price to changes in the value of the underlying asset. |
"gamma" or "g" | gamma is a second order Greek that measures the sensitivity of delta to changes in the value of the underlying asset. |
"theta" or "t" | Represents the sensitivity of the option price to changes in the time to maturity. |
"vega" or "e" | Represents the sensitivity of the option price to changes in volatility. |
"volga" or "o" | volga is a second order Greek that measures the sensitivity of vega to changes in volatility. |
"vanna" or "a" | vanna is a second order Greek that measures the sensitivity of delta to changes in volatility. |
"rho" or "r" | Represents the sensitivity of the option price to changes in the (domestic) interest rate. |
"rhof" or "f" | Represents the sensitivity of the option price to changes in the foreign interest rate. |
- If any of Spot, Volatility, Rate, Foreign rate, Maturity, Lower barrier, or Upper barrier is non-numeric, then OPT_TOUCH reports a #VALUE! error.
- If either Spot or Volatility is less than or equal to 0.0, then OPT_TOUCH reports an invalid argument error (Err:502).
- If Maturity is less than 0.0, then OPT_TOUCH reports an invalid argument error (Err:502).
- If any of Foreign/Domestic, Knock-In/Out, Barrier type, or Greek does not satisfy the constraints given above, then OPT_TOUCH reports an invalid argument error (Err:502).
Additional details:
Details specific to OPT_TOUCH function
- Further information about touch / no-touch options may be found on many financial websites.
- The name space for OPT_TOUCH is
COM.SUN.STAR.SHEET.ADDIN.PRICINGFUNCTIONS.GETOPTTOUCH
.
General information about Calc's option valuation functions
- In finance, an option is a contract that provides the right to purchase or sell an asset at a predetermined price in a specific time-frame. More background information can be found on Wikepedia's Option (finance) page and in the sources that it references.
- Calc provides four functions that can be used in the valuation of financial options and these are:
- OPT_BARRIER – calculates the pricing for a barrier option.
- OPT_TOUCH – calculates the pricing for a touch / no-touch option.
- OPT_PROB_INMONEY – calculates the probability that an asset will end up between two barrier levels at maturity.
- OPT_PROB_HIT – calculates the probability that an asset hits a predetermined barrier price.
- Such functions are not specified in ODF 1.2 and are not available in other popular spreadsheet applications.
- These four functions are based on an implementation of the widely-used Black-Scholes pricing model, which assumes that the value of the underlying asset can be modeled as a geometric Brownian motion. The mathematics behind this model is beyond the scope of this wiki but more information can be found on Wikipedia's Black–Scholes model page and in the sources that it references.
Examples:
Worked example, including calculation of all Greeks
A | B | C | D | E | |
---|---|---|---|---|---|
1 | Spot | 1.2 | price | 860.66391608499600 | |
2 | Volatility | 12% | delta | 1,144.12757620840000 | |
3 | Rate | 1% | gamma | −61,435.34038188970000 | |
4 | Foreign rate | 2% | theta | 659.29777915478300 | |
5 | Maturity | 0.4137 | vega | −4,411.45133663778000 | |
6 | Lower barrier | 1.05 | volga | −48,120.74826257920000 | |
7 | Upper barrier | 1.4 | vanna | 4,946.72395191636000 | |
8 | Foreign/Domestic | d | rho | 94.32777963799720 | |
9 | Knock-In/Out | o | rhof | −450.38444172236100 | |
10 | Barrier type | c |
In the above data:
- Cells B1:B10 contain the values for all arguments, except Greek.
- Cells E1:E9 contain the values calculated for the various Greek arguments (listed in cells D1:D9).
- Cell E1 contains the formula
=1000*OPT_TOUCH($B$1, $B$2, $B$3, $B$4, $B$5, $B$6, $B$7, $B$8, $B$9, $B$10, $D1)
and this returns the same value that would be obtained by omitting the Greek argument. Note that the multiplicative factor of 1000 is included for convenience. - Cell E2 contains the formula
=1000*OPT_TOUCH($B$1, $B$2, $B$3, $B$4, $B$5, $B$6, $B$7, $B$8, $B$9, $B$10, $D2)
. - The formulas for cells E3:E9 are similar, with the cell referenced in the final argument updated accordingly.
Other examples
Formula | Description | Returns |
---|---|---|
=OPT_TOUCH(80; 0.2; 0.05; 0; 0.5; 60; 0; "f"; "o"; "c"; "r") | The function calculates the rho Greek for a touch/no-touch option with the specified characteristics. | 15.5516423091662 |
=OPT_TOUCH(50; 0.25; 0.05; 0; 1; 0; 55; "d"; "i"; "c") | The function calculates the pricing for a touch/no-touch option with the specified characteristics. The Greek argument is omitted and so the function defaults to returning the price. | 0.687637887461457 |
Related LibreOffice functions:
ODF standard:
None
Related (or similar) Excel functions:
None