Delta-hedging simulator

Sell an option, hedge it with the stock, and see what you are left with at expiry. The Greeks stop being a table and become money: hedge at the volatility you sold, and the book earns ½(σ²ᵢₘₚ − σ²ᵣₑₐₗ) S² Γ per unit of time, plus noise from hedging only now and then, minus what the trading costs.

Contract

$

Spot price (S)

$

Strike (K)
Implied volatility (sold at)
The volatility the option is priced and hedged at
Time to maturity (T)
Years
Risk-free rate (r)
Annualised, 0.05 = 5%
Dividend yield (q)
Annualised, continuous
Try this
0 of 3 done
The world
Realised volatility
What the spot actually does
Drift
Real-world expected return
The hedge
Rebalance
Cost (bps of traded value)
Steps
252 = daily for a year
Paths
Seed
Premium received

$10.45

Sold at 20.0%
Average result at expiry

-$0.007

± 0.015 over 1,000 paths
Theory says

+$0.000

½(σ²ᵢₘₚ − σ²ᵣₑₐₗ) S² Γ summed over the life
Spread of results

0.468

50% of paths profitable; costs 0.000 per path

Sold at exactly the realised volatility, the book breaks even on average: everything left is the noise of hedging only now and then.

The book is the short option, the shares and the cash, marked to market at the implied volatility. It drifts with the theoretical line and wobbles around it: the wobble is the cost of not hedging continuously, largest when Gamma is large.
A tighter histogram means a better hedge. Hedge more often and it narrows; add costs and it shifts left.
Watch the hedge

The path in the charts above plays in time, 252 steps from today to expiry. On each rebalancing date the hedge trades back to the Black-Scholes delta; in between it holds still while the delta moves on. Below, the book's profit builds up against what theory says a continuous hedge earns, and the gap between them is the hedging error. The thin line is the same path hedged 20 times as often, without costs, which is close to continuous hedging: it wobbles far less, because the error shrinks with the square root of the time between trades.

Playback speed
Spot Strike
Shares held (discrete hedge) Black-Scholes delta (continuous hedge)
Hedged book (discrete) Theory (continuous hedge) Hedging error Hedged near-continuously

On this path the hedged book ends at +$0.169, against +$0.000 from theory: a hedging error of +$0.169. Hedged near-continuously it ends at +$0.099.

An unhandled error has occurred. Reload ๐Ÿ—™

Reconnecting…

Your connection to Derivatives Lab dropped, probably a Wi-Fi blip. Hold on while it reconnects. Your inputs are kept.

The connection could not be restored. The page will reload in a few seconds and your inputs will reset.