Theory of Operation

This page provides a brief description of what's going on under the covers of the Option Risk Calculator.

The option risk calculator models stock price changes using the same assumption made by option pricing models like Black-Scholes: that stock price returns follow a pattern called geometric Brownian motion. In particular, this means that:

Is geometric Brownian motion a good model for stock price movements? This has been debated extensively, and the short answer is: sort of. It does a good job of describing normal day-to-day, month-to-month (and so on) price movement, but not describing large movements - which occur more often than predicted by the model.

Despite its limitations, geometric Brownian motion is the assumption behind option pricing models like Black-Scholes, and behind almost all stock price probability calculators. In addition to working pretty well much of the time, it has some convenient mathematical properties.

So let's look at what happens to a stock price over some period of time. Here are the inputs needed to characterize geometric Brownian motion:

Starting Price
This, of course, is where the motion begins. We'll call it P.
Growth Rate
This introduces an upward or downward drift - a trend - to the motion. Call it R. (Note that this tool is unusual in exposing this value in configuring the trades. Most risk charting tools assume a value equal to the "risk-free rate" used as an input to the Black-Scholes model.)
Volatility
This determines how widely the returns vary. Call it V.

With these inputs, geometric Brownian motion predicts this movement for the log of the return (recall from the above discussion that we're talking about ln(Pricetoday / Priceyesterday)):

Return = random × V + ln(1 + R)

That return results in this predicted stock price:

New Price = P × erandom × V - V2/2 × (1 + R)

Where random is a normally distributed random number, with a mean of 0 and a standard deviation of 1. Clearly, this does not predict a single price but, on repeated evaluation, it predicts a distribution of prices following the lognormal curve.

What move have we described here, anyway - the daily price change? Weekly? Annual?

Answer: All of them. If you use annual growth rate and volatility, you've described an annual move. If you use daily growth rate and volatility, you've described a daily move. If you apply the daily calculation every day for a year, you get the same distribution of values as applying the annual rate once (this is the convenient mathematical property mentioned above).

That's the core of the theory behind this and other option price calculators. The rest is application of standard statistical techniques. Here, in case you want to try it at home, is what this calculator does under the covers:

Define the normal cumulative density function:

cdf(x) = 1 + erf(x / sqrt(2)) / 2

where erf is the standard error function.

Define the following quantities:

P = starting price
V = annualized volatility, as a fraction (not a percent)
R = compounded annual growth rate as a fraction (not a percent)

To compute the distribution of prices over a particular period of time, define t to be the amount of time, in years, being evaluated. For example, to evaluate a price distribution 47 days in the future, you can define t to be 47/365.25. With t defined, compute the volatility and log(return rate) for the period being evaluated:

S = V × sqrt(t)
L = ln(1 + R) × t

Compute the median predicted price, where the lognormal distribution will reach its peak:

M = P × eL - S2 / 2

From here, we can compute the probability functions of interest. For a particular price Q, compute its distance in standard-deviations from the median:

D = ln(Q / M) / S

and use that value to compute the probability functions. The value of the probability density function (the lognormal curve in the risk chart) at that price is:

e-D2 / 2 / sqrt(2 × π)

The cumulative probability density - the probability of finishing at or below the price - is:

cdf(D)

So the probability of finishing at or above the price is:

1 - cdf(D)

That's all the math behind forecasting price probabilities. The remaining math is in computing the value of the trade at a particular price at a particular time - which is just a matter of computing the value of each position at that price and adding them up. This total is the sum of:

This calculation only makes sense up to the first option expiration, which is why risk charts cannot show trade value or P/L past that point.

That's all the math. That said, here is what the option risk calculator is doing:


HomeStarting OutRisk ChartsOutcome Probability ChartsAnalyzing the Full TradeTheory of OperationContact InformationFrequently Asked Questions

DISCLAIMER: This risk calculator is for educational purposes only, and is not intended as a basis for trading decisions. Use at your own risk.