- What you'll learn
- What "mean reversion" means and when it tends to work
- How to measure deviations with z-scores and moving averages
- How to estimate and use half-life of mean reversion
- How professionals test stationarity and cointegration
- How to design entry/exit rules and size positions safely
- How to account for frictions: costs, slippage, and regime shifts
- How to apply mean reversion to stocks, ETFs, and pairs
- Concept explanation Mean reversion is the idea that an asset’s price or a spread between assets tends to drift back toward a typical level (its "mean") after deviating. Think of a rubber band: pull it too far and it snaps back. In markets, this can show up when prices overshoot on news, or when supply-demand imbalances cause temporary dislocations.
There are two major flavors. First, single-asset mean reversion: a stock’s price oscillates around a moving average. Second, cross-asset or relative mean reversion: a spread (like the price difference between two similar stocks, or a stock vs. its sector ETF) reverts to a stable relationship. The second type is often more robust because relationships can be more stationary than raw prices.
A key concept is stationarity: a stationary series has a constant average and variance over time and tends to return toward its mean. Many raw prices trend and are non-stationary, but constructed spreads (for example, between cointegrated stocks) can be stationary and thus better suited to mean-reversion strategies.
- Why it matters Mean reversion can generate trade ideas that are logically orthogonal to momentum. Momentum buys strength; mean reversion fades extremes. That diversification can reduce overall portfolio volatility when combined thoughtfully.
It’s also a practical framework for risk management. If you know approximately how quickly a series tends to revert (its "speed" of mean reversion), you can plan holding periods, set stop-losses, and estimate how much noise to tolerate. In professional settings, traders test whether their target signal really reverts, estimate how persistent the property is, and quantify expected edge after costs.
Finally, mean reversion highlights the importance of market microstructure. Short-term reversals can be driven by liquidity, spreads, and investor flows. Ignoring transaction costs and slippage can wipe out the edge. Professionals often optimize execution (limit orders, VWAP/TWAP, time-of-day effects) to preserve profitability.
- Calculation method Below are core steps and formulas used by practitioners.
Step 1: Define the reference mean and dispersion
- For a single asset, use a moving average over a window (e.g., 20 days) and its rolling standard deviation.
- Compute a standardized deviation (z-score):
Interpretation: Z_t around 0 is near typical; Z_t at -2 means the price is 2 standard deviations below its mean (statistically unusual, but not rare).
Step 2: Estimate mean-reversion speed For a stationary series X_t (this could be a spread), fit an AR(1):
X_t = c + \phi X_{t-1} + \varepsilon_tMean reversion implies |\phi| \lt 1 and typically 0 \lt \phi \lt 1. From \phi, approximate the half-life (how long it takes to close half the gap to the mean):
HalfLife \approx -\frac{\ln(2)}{\ln(\phi)}Continuous-time view (Ornstein–Uhlenbeck (OU) process):
dX_t = k(\mu - X_t)\,dt + \sigma\,dW_tHere, k is the speed of mean reversion. The OU half-life is:
HalfLife = \frac{\ln(2)}{k}Step 3: Test for stationarity (single series) or cointegration (pairs)
- Augmented Dickey–Fuller (ADF) test for stationarity of X_t. A significant result (p-value) suggests stationarity.
- For pairs trading, first regress y on x to form a spread e_t:
Then test e_t for stationarity (ADF). If e_t is stationary, x and y are cointegrated, enabling a mean-reverting spread.
Step 4: Design entry/exit rules
- Z-score thresholds: Enter long when Z_t \leq -2, exit at Z_t = 0; mirror for shorts.
- Time-based exits: Close the trade after the estimated half-life or some multiple, to avoid getting stuck.
- Stop-loss: Cap losses when Z becomes extreme without reverting (e.g., Z \leq -3 for long) or when a regime test signals breakdown.
Step 5: Position sizing
- Volatility scaling: Target a volatility budget; position size inversely to RollingStd_t.
- Kelly fraction (advanced):
Use a fractional Kelly (e.g., 0.25–0.5 f*) to reduce risk of drawdowns and estimation error.
Worked examples Example A: Single-stock reversion
- 20-day mean = 100, 20-day std = 5, current price = 90.
- Z = (90 - 100) \div 5 = -2. Enter a small long.
- If \phi from AR(1) is 0.8, half-life \approx -ln(2) \div ln(0.8) \approx 3.1 days. Consider a 3–5 day holding horizon.
Example B: Cointegrated pair
- Regression of y on x yields a = 2, b = 1.5.
- Today, x = 50, y = 80; spread e = 80 - (2 + 1.5 \times 50) = 80 - 77 = 3.
- Using spread’s rolling mean = 0, rolling std = 2.5, Z = 3 \div 2.5 = 1.2. No trade yet if threshold is \pm 2.
- Case study Scenario: Pairs trade between two US retail stocks (call them Stock A and Stock B) with similar business models. You test daily data over 5 years.
Step 1: Build the spread
- Regress A on B over the first 2 years (in-sample) to get hedge ratio b = 0.9, intercept a = 0.5.
- Define spread: e_t = A_t - (0.5 + 0.9 B_t).
Step 2: Test stationarity
- ADF test on e_t returns test statistic -3.9 with p-value 0.01. You treat the spread as stationary.
Step 3: Estimate mean reversion
- Fit AR(1): e_t = 0.02 + 0.75 e_{t-1} + \varepsilon_t.
- Half-life \approx -ln(2) \div ln(0.75) \approx 2.4 days. Expect most trades to resolve in about 2–5 days.
Step 4: Set rules
- Entry: Z \geq 2 short the spread (short A, long 0.9 B); Z \leq -2 long the spread.
- Exit: Z back to 0 or after 5 days, whichever first.
- Stop: Z \geq 3 (for short) or Z \leq -3 (for long).
Step 5: Execution and costs
- Use passive limit orders when liquidity allows; otherwise, work orders near the close to match spread calculations. Assume round-trip cost of 10 bps per leg; slippage 5 bps per leg in stressed times.
Step 6: Out-of-sample performance (last 3 years)
- Trades: 320 total, hit rate 57%.
- Average gross return per trade: 18 bps; net after costs: ~8 bps.
- Average holding period: 2.7 days; annualized Sharpe of the strategy sleeve: 1.0.
Interpretation: The edge is modest but consistent. Tightening thresholds reduces trade count but increases average P&L per trade; loosening thresholds does the opposite. Performance degrades during earnings season and macro shocks, suggesting a regime filter could help.
- Practical applications
- Single-stock pullbacks: Fade overreactions after ex-dividend adjustments, basket rebalances, or temporary liquidity vacuums. Use Z-scores on short windows (5–20 days) and cap position sizes during news windows.
- Sector vs. stock: Trade a stock’s deviation from its sector ETF using a regression-based residual. This often reduces market beta and targets idiosyncratic mean reversion.
- Pairs trading: Find cointegrated pairs within the same industry (banks, utilities). Rebalance hedge ratios periodically (e.g., monthly) to adapt to slow structural changes.
- Intraday reversion: On liquid ETFs, microstructure effects can drive short-horizon reversals near the open or close. Execution quality is crucial; cost control can make or break the edge.
- Portfolio construction: Combine multiple mean-reversion signals across assets. Use volatility targeting and correlation-aware position sizing to prevent concentration in highly correlated bets.
- Regime filters: Turn down exposure when volatility spikes, when spreads fail stationarity tests, or when a trend filter (e.g., 50d \gt 200d moving average) indicates a trending market where reversion is weaker.
- Common misconceptions
- Summary
Advanced considerations and professional discussions
- Hurst exponent (H): Professionals estimate H to diagnose mean-reversion (H \lt 0.5) vs. trending (H \gt 0.5) behavior over chosen horizons. Be mindful that H is scale-dependent and noisy.
- State-space and Kalman filters: For time-varying hedge ratios and latent means, a Kalman filter can estimate a dynamic spread and volatility, improving stability vs. fixed rolling windows.
- Robust z-scores: Replace mean/std with median and median absolute deviation (MAD) to reduce sensitivity to outliers.
- Multiple testing: If you scan hundreds of pairs, use out-of-sample validation and false-discovery control. Consider White’s reality check or deflated Sharpe ratio to adjust for data snooping.
- Execution alpha: Queue positioning, midpoint pegs, and time-of-day seasonality can add several basis points per trade to a fragile edge.
- Risk budgeting: Cap exposure by spread and by industry; run stress tests assuming a regime shift where \phi \to 1 (no reversion) and spreads widen 3–5 standard deviations.
Glossary
Mean reversion: The tendency of a price or spread to move back toward a typical level after deviating.
Stationarity: A property of a time series with stable mean and variance over time, often necessary for mean reversion.
Z-score: Standardized deviation from a mean, measured in units of standard deviation.
Half-life: Expected time for half of a deviation from the mean to decay.
Ornstein-Uhlenbeck process: A continuous-time model of mean-reverting dynamics with speed k and volatility sigma.
Cointegration: A statistical relationship where a linear combination of non-stationary series is stationary.
Pairs trading: A strategy that trades a mean-reverting spread between two related assets.
Hurst exponent: A measure of long-term memory in time series; H<0.5 suggests mean-reverting behavior.
Regime shift: A change in market behavior that alters statistical properties like trend or volatility.
Slippage: The difference between expected trade price and executed price, often due to market impact or liquidity.