Skip to main content
QuantDXB

Markets and trading · 12 min read

Delta hedging

Sell an option, hold delta shares, rebalance: a simulation of what is left over, why it shrinks like 1/√N, and why hedging can't remove the bet on volatility.

Before you start

  • Options and the Greeks (this track)
  • Random walks and Brownian motion

By the end you'll be able to

  • Simulate a delta-hedged short option position
  • Explain and estimate the hedging error from discrete rebalancing
  • Explain why a hedged option is a position in volatility
  • Reason about the trade-off between hedging frequency and costs

The Black–Scholes price rests on a claim: a trader who sells an option can remove all of its risk by holding the right number of shares, adjusted continuously. In practice "continuously" means a few times a day at best, every trade costs money, and the volatility you priced with is not the volatility you get. This lesson simulates the hedge and measures what is left: a hedging error that shrinks with rebalancing but never vanishes, and a bet on volatility that hedging can't remove.

SymbolMeaning
Δ\DeltaDelta: the number of shares held per option
NNThe number of times the hedge is rebalanced before expiry
implied volThe volatility used to price the option (and compute its delta)
realised volThe volatility the stock actually turns out to have
vegaThe option price's sensitivity to volatility (see the Greeks)
hedging errorThe P&L left over after hedging: zero for a perfect hedge

The hedge

Sell one call for its Black–Scholes price. To offset the risk, buy Δ\Delta shares, borrowing what the premium doesn't cover. As the stock moves, delta changes, so at each rebalance buy or sell shares to bring the holding back to the new delta. At expiry, sell the shares, pay the option's payoff, and see what is left.

If the stock really followed geometric Brownian motion with the volatility used for pricing, and you could rebalance continuously at no cost, what is left would be exactly zero. That is the replication argument behind Black–Scholes, and it is why the option's price doesn't depend on the stock's expected return.

Hedging error

With NN rebalances, between each one the position is only hedged against small moves. The gamma of the short option means that a large move in either direction costs money before the next rebalance, and a quiet period earns the theta. These don't cancel exactly on any one path, so the final P&L is random.

Choose the number of rebalances below. Each bar counts paths by their final P&L:

Rebalances over 3 months
Realised volatility
Paths
0
Average P&L
–
Spread (sd)
–
Theory √(π/4)·vega·σ/√N
0.87
Each path: sell a 3-month at-the-money call priced at 20% volatility, hold delta shares, rebalance N times. With realised volatility at 20% the P&L centres on zero and narrows like 1/√N. At 30% the stock moves more than the price allowed for, and the seller loses on average however often they hedge.

With realised volatility equal to implied (20%), the P&L centres on zero, and its spread shrinks by about half each time the number of rebalances is multiplied by four. That is the familiar 1/N1/\sqrt{N}, and there is an approximate formula for it, due to Derman and Kamal:

sd⁡(hedging error)≈π4  vega⋅σN.\operatorname{sd}(\text{hedging error}) \approx \sqrt{\frac{\pi}{4}}\;\frac{\text{vega}\cdot\sigma}{\sqrt{N}}.

For this 3-month at-the-money call (vega 19.64 per 1.00 of volatility), the simulation in the code below gives:

RebalancesSimulated spreadFormula
41.6001.741
160.8450.870
640.4180.435
2560.2160.218

The option's price is about 4.6, so even hedging 256 times leaves a typical error of about 5% of the premium. In real markets each rebalance also pays the spread, so hedging more often reduces risk but raises costs. Choosing how often to hedge is a real trade-off, and desks often rebalance when delta has drifted by more than a threshold rather than on a fixed schedule.

Key idea. Discrete hedging leaves an error that shrinks like 1/N1/\sqrt{N}. Reducing it costs transaction costs; a hedge is a choice about how much risk to keep.

Hedging doesn't remove the volatility bet

Now set realised volatility to 30% while the option is still priced, and hedged, at 20%. The whole distribution moves left: the seller loses on average, about 1.96 per option, however often they rebalance. That loss is almost exactly vega times the volatility gap, 19.64×0.10=1.9619.64 \times 0.10 = 1.96.

The reason is gamma. Every move costs the short-gamma hedger about 12Γ(δS)2\tfrac{1}{2}\Gamma(\delta S)^2, and theta pays them back an amount set by the implied volatility. When the stock moves more than implied, the costs win on every path, and hedging more often doesn't change that: it only makes the outcome more certain.

This is the most important practical point about options. A delta-hedged option is a position in volatility: the buyer wins if realised volatility beats implied, the seller wins if it doesn't. The implied volatility in the price is the market's estimate, and option trading is largely about whether that estimate is too high or too low.

Key idea. Delta hedging removes exposure to the stock's direction, not to its volatility. A hedged option seller profits when the stock moves less than the price implied, and loses when it moves more.

In code

python
from math import erf, exp, log, pi, sqrt

import numpy as np

def N(x):
    return 0.5 * (1 + erf(x / sqrt(2)))

def bs_call(S, K, r, sigma, T):
    if T <= 0:
        return max(S - K, 0.0), (1.0 if S > K else 0.0)
    d1 = (log(S / K) + (r + sigma**2 / 2) * T) / (sigma * sqrt(T))
    d2 = d1 - sigma * sqrt(T)
    return S * N(d1) - K * exp(-r * T) * N(d2), N(d1)

def hedged_pnl(rebalances, realised_vol, rng, S=100.0, K=100.0, r=0.05, implied_vol=0.20, T=0.25):
    """Sell one call at the implied-vol price and delta-hedge it until expiry."""
    dt = T / rebalances
    price, delta = bs_call(S, K, r, implied_vol, T)
    cash = price - delta * S  # premium received, minus the shares bought
    for step in range(1, rebalances + 1):
        S *= exp((r - realised_vol**2 / 2) * dt + realised_vol * sqrt(dt) * rng.standard_normal())
        cash *= exp(r * dt)
        _, new_delta = bs_call(S, K, r, implied_vol, T - step * dt)
        if step < rebalances:
            cash -= (new_delta - delta) * S  # rebalance the hedge
            delta = new_delta
    return cash + delta * S - max(S - K, 0.0)  # unwind the shares, pay the option's payoff

rng = np.random.default_rng(5)
for rebalances in (4, 16, 64, 256):
    pnl = np.array([hedged_pnl(rebalances, 0.20, rng) for _ in range(4000)])
    print(f"{rebalances:>3} rebalances: mean {pnl.mean():+.3f}, sd {pnl.std():.3f}")

pnl = np.array([hedged_pnl(64, 0.30, rng) for _ in range(4000)])
print(f"realised 30% vs implied 20%, 64 rebalances: mean {pnl.mean():+.3f}, sd {pnl.std():.3f}")

The means for the four rebalancing frequencies are −0.054-0.054, 0.0000.000, −0.002-0.002 and 0.0000.000, all within noise of zero, with the spreads in the table above. The last line prints a mean of −1.962-1.962 with spread 1.080 when realised volatility is 30%.

Where this shows up in quant work

  • Options desks delta-hedge continuously and manage what is left: gamma, vega and the costs of hedging. Deciding when to rebalance is a daily, quantitative decision.
  • Volatility trading. Buying options and delta-hedging them is the standard way to bet that realised volatility will exceed implied. The P&L in this lesson is exactly that trade's.
  • Model risk. The hedge depends on the model's delta. If the model is wrong (for example, volatility changes with the stock price), the hedge leaks, and that leak is measured the same way.

Exercises

  • Add a transaction cost of 1 cent per share traded to hedged_pnl. At what number of rebalances does the average cost start to outweigh the reduction in spread?
  • Rebalance only when delta has moved by more than 0.05 since the last trade. How many trades does that take on average, and what spread does it achieve compared with fixed schedules?
  • Set realised volatility to 15%. What happens to the hedged seller's average P&L, and how does it compare with vega × (realised − implied)?

Key takeaways

  • Selling an option and holding delta shares, rebalanced, replicates the option only in the limit of continuous, costless trading.
  • With NN rebalances the hedging error has spread about π/4 vega σ/N\sqrt{\pi/4}\,\text{vega}\,\sigma/\sqrt{N}; costs make infinite rebalancing impossible.
  • Hedging removes direction, not volatility: the hedged P&L is about vega times (implied − realised) for the seller.
  • Implied volatility is a price; option trading is largely a view on whether it is too high or low.