# Documentation/Calc Functions/OPT PROB HIT

TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate

## Function name:

OPT_PROB_HIT

## Category:

Financial Analysis

## Summary:

Calculates the probability that an asset hits a predetermined barrier price, using the Black-Scholes option pricing model.

## Syntax:

OPT_PROB_HIT(**Spot**; **Volatility**; **Drift**; **Maturity**; **Lower barrier**; **Upper barrier**)

## Returns:

Returns a real number in the range [0, 1] which is the probability that an asset hits a predetermined barrier price for an option with the specified characteristics.

## 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.

**Drift** 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 annual stock price percentage drift 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.

- If any argument is non-numeric, then OPT_PROB_HIT reports a #VALUE! error.
- If either
**Spot**or**Volatility**is less than or equal to 0.0, then OPT_PROB_HIT reports an invalid argument error (Err:502). - If
**Maturity**is less than 0.0, then OPT_PROB_HIT reports an invalid argument error (Err:502).

## Additional details:

### Details specific to OPT_ PROB_HIT function

- The name space for OPT_PROB_HIT is
`COM.SUN.STAR.SHEET.ADDIN.PRICINGFUNCTIONS.GETOPTPROBHIT`

.

### 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:

Formula | Description | Returns |
---|---|---|

=OPT_PROB_HIT(B1; B2; B3; B4; B5; B6) where cells B1:B6 contain the values 30, 20%, 15%, 1, 0, and 40 respectively. | Here the function calculates the probability that the asset hits a predetermined barrier price as 33.4%. | 0.334478013926324 |

=OPT_PROB_HIT(70; 0.3; 0.1; 0.5; 60; 0) | Here the function calculates the probability that the asset hits a predetermined barrier price as 42.4%. | 0.423889647113691 |

## Related LibreOffice functions:

## ODF standard:

None

## Related (or similar) Excel functions:

None