All simulations
Mean reversion and pairs trading
Simulate a spread that snaps back to its average and trade it, until the relationship breaks.
θ: the share of the gap to the average closed each day.
Bet on a snap back once the spread is this many standard deviations from its average.
Half-life13.5 days
Trades7
Win rate86%
Final profit+24.9In spread points, one unit
The first 100 days are used to measure the average and the bands. Teal shading: long the spread. Coral: short.
The spread closes half its gap to the average in about 13.5 days. Fading moves beyond ±1.5 standard deviations, the strategy won 86% of 7 trades. High win rates are typical here. The danger is the one trade that never comes back.
Profit over time, same shocks
Across 300 simulated markets
Profitable, mean-reverting spread100%
Profitable, random-walk spread50%
Average profit, mean-reverting34.3
One good chart proves little. The edge is real only if it holds across many markets, and only while the relationship itself holds.
Try this
- Set the pull to zero. The bands still trigger trades, but across 300 markets the strategy is a coin flip.
- Raise the pull toward 0.3. The half-life shrinks to a couple of days and trades come quickly.
- Switch on the relationship break and watch one open trade wipe out months of small wins.
The math
- the spread on day t, for example the price gap between two related stocks
- speed of mean reversion
- long-run average
- size of daily noise
- a standard normal shock
- half-life: days to close half the gap