Strategies9 min read
Mean reversion without catching every falling knife
A practical mean‑reversion setup: apply regime, extension, liquidity, and invalidation filters with OU or z‑score bands and a reproducible test plan.
By TerraTrade Team

Mean reversion works best when you’re selective. This guide shows how to frame a mean reversion trading strategy with four concrete filters—regime, extension, liquidity, and invalidation—so you avoid trying to buy every vertical drop or fade every breakout. Each filter maps to a measurable hypothesis you can backtest for stocks and futures. We also include a step‑by‑step build, instrumentation, and journal tags so your results are reproducible.
Mean reversion, as used in research—not just “buying dips”#

| Filter | Purpose | Example testable rule | Literature anchor |
|---|---|---|---|
| Regime | Avoid trading reversion during persistent trends or regime transitions | Only allow entries when a regime classifier indicates a low‑trend/mean‑reverting state (e.g., a Markov‑switching low‑vol/low‑trend state) | Regime segmentation via Markov switching is standard in macro/time‑series modeling A New Approach to the Economic Analysis of Nonstationary Time Series and the Business |
| Extension | Define “far enough” but not “structurally broken” | Enter long when the residual’s z‑score is at or below a negative entry threshold but not beyond a maximum cap; exit toward zero | Distance/z‑score rules are canonical in pairs trading Pairs Trading: Performance of a Relative-Value Arbitrage Rule by Evan Gatev, William N. Goetzmann, K. Geert Rouwenhorst :: SSRN; OU‑based optimal bands formalize thresholds Optimal Mean-Reverting Spread Trading: Nonlinear Integral Equation Approach |
| Liquidity | Control execution and slippage risk | Require minimum daily dollar volume and a maximum bid‑ask spread; adapt size to execution quality | Trading cost modeling is integral to stat‑arb design Statistical Arbitrage in the U.S. Equities Market |
| Invalidation | Force outliers to be recognized quickly | Use a hard stop if the adverse z‑score breaches a stop threshold, or a model‑derived stop region; add a time‑stop if reversion stalls | Transaction costs affect optimal bands in OU frameworks Optimal Mean-Reverting Spread Trading: Nonlinear Integral Equation Approach |
Define the setup: signal + regime + extension + liquidity + invalidation#
Signal (residual):
- Construct a stationary residual you can trade. Options include: (a) regression of an asset on market/sector factors with the residual as the series; (b) a pair spread; (c) a PCA factor‑neutralized idiosyncratic return. In practice, many statistical‑arbitrage approaches then model the residual as OU/AR(1) with rolling parameters Statistical Arbitrage in the U.S. Equities Market.
- Standardize to a z‑score using a rolling mean and standard deviation appropriate to your timeframe. OU approaches can estimate the mean and the mean‑reversion speed directly, informing dynamic bands Statistical Arbitrage in the U.S. Equities MarketOptimal Mean-Reverting Spread Trading: Nonlinear Integral Equation Approach.
Regime filter (do not fight a trend):
- Hypothesis: the residual’s reversion is more reliable in low‑trend, lower‑volatility states. Use a regime classifier and only allow entries when that state is active.
- Implementations: a two‑ or three‑state Markov‑switching model on returns or volatility; or a simpler momentum/volatility score with a threshold. Markov‑switching regime segmentation is a well‑established tool in economics and time‑series analysis and is directly applicable here A New Approach to the Economic Analysis of Nonstationary Time Series and the Business.
Extension filter (how far is far enough?):
- Distance rule: require the absolute z‑score to meet or exceed an entry threshold but cap participation if the absolute z‑score is above a maximum. Distance/z‑score methods are the baseline in pairs‑trading research Pairs Trading: Performance of a Relative-Value Arbitrage Rule by Evan Gatev, William N. Goetzmann, K. Geert Rouwenhorst :: SSRN.
- OU‑optimal bands: estimate the reversion speed and volatility of the residual and compute optimal entry/exit bands that account for costs; this avoids arbitrary entry/exit levels Optimal Mean-Reverting Spread Trading: Nonlinear Integral Equation Approach.
Liquidity filter (make fills credible):
- Hypothesis: realized edge is sensitive to trading costs and execution frictions. Require minimum daily dollar volume, cap quoted/effective spread, and down‑weight or skip assets failing these thresholds.
- Rationale: transaction costs and execution frictions are first‑order in statistical‑arbitrage design and should be modeled and constrained in testing Statistical Arbitrage in the U.S. Equities Market.
Invalidation (define “you’re wrong”):
- Price‑based: use a hard stop when the long entry’s z‑score becomes more negative than a stop threshold (and the mirror for shorts).
- Model‑based: use OU‑derived exit/stop regions that incorporate costs; the optimal policy defines where persistence outweighs expected reversion Optimal Mean-Reverting Spread Trading: Nonlinear Integral Equation Approach.
- Time‑based: if reversion hasn’t occurred within a fixed number of bars and the regime or reversion‑speed estimate deteriorates, exit. OU policies shift with the estimated speed Optimal Mean-Reverting Spread Trading: Nonlinear Integral Equation Approach.
Entry, exit, and invalidation hypotheses#
From rules to a test: plan and instrumentation#
- Choose your universe and bar interval. For equities, define a liquid universe (for example, top ranks by dollar volume). For futures, verify the live contract specifications—multiplier, tick size, and session hours—on the exchange before testing or managing rolls.
- Construct the residual. Options: factor‑neutral residual (regression or PCA) or a pair spread. Fit a rolling OU/AR(1) or estimate a rolling mean and standard deviation with a robust window Statistical Arbitrage in the U.S. Equities Market.
- Standardize to a z‑score and precompute realized volatility per asset or residual. Log both raw and winsorized values for diagnostics.
- Build the regime classifier. A two‑ or three‑state Markov‑switching model on returns or volatility is a concrete, testable option A New Approach to the Economic Analysis of Nonstationary Time Series and the Business. Store state probabilities and transitions; define a binary “allow entries” flag.
- Specify the extension rule. Start with entry, exit, and maximum‑extension levels for a distance rule aligned with pairs‑trading convention Pairs Trading: Performance of a Relative-Value Arbitrage Rule by Evan Gatev, William N. Goetzmann, K. Geert Rouwenhorst :: SSRN, or compute OU‑optimal bands that incorporate your cost model Optimal Mean-Reverting Spread Trading: Nonlinear Integral Equation Approach.
- Define liquidity gates. Set minimum daily dollar volume and maximum effective spread thresholds appropriate to your timeframe. Record the value used at each decision to avoid survivorship bias. Tie your size or pass/skip to this gate Statistical Arbitrage in the U.S. Equities Market.
- Encode invalidation. Implement stop bands (price‑ or model‑based) and a time‑stop. Ensure stops are simulated with intrabar logic consistent with your bar type.
- Simulate with realistic frictions. Include commissions and slippage consistent with your venue and size; statistical‑arbitrage models emphasize execution costs Statistical Arbitrage in the U.S. Equities Market.
- Segment by regime and extension. Produce performance broken out by allowed/blocked regimes and by z‑score buckets to test whether the filter actually adds value.
- Hold out data. Split sample into training, validation, and final test. Freeze parameters before the final test. Report both gross and net results and the fraction of signals filtered out.
- Stress and sensitivity. Shock the estimated reversion speed, volatility, and cost inputs to see how OU‑band policies and fixed‑z rules behave under parameter error Optimal Mean-Reverting Spread Trading: Nonlinear Integral Equation Approach.
| Metric / tag | Definition you will log | Why it matters |
|---|---|---|
| regime-state | Discrete state and its probability at entry/exit | Verifies regime‑gating logic A New Approach to the Economic Analysis of Nonstationary Time Series and the Business |
| z-at-entry, z-at-exit | Standardized residual at decision times | Confirms extension/exit discipline Pairs Trading: Performance of a Relative-Value Arbitrage Rule by Evan Gatev, William N. Goetzmann, K. Geert Rouwenhorst :: SSRNOptimal Mean-Reverting Spread Trading: Nonlinear Integral Equation Approach |
| ou-kappa, ou-sigma | Rolling OU reversion‑speed and volatility estimates | Explains shifting optimal bands and failures Optimal Mean-Reverting Spread Trading: Nonlinear Integral Equation Approach |
| liquidity-pass, spread-bps, dollar-volume | Liquidity snapshot used for eligibility and sizing | Links results to execution quality Statistical Arbitrage in the U.S. Equities Market |
| costs-per-share or per-contract | Commissions and slippage assumptions used | Keeps net P&L comparable and realistic Statistical Arbitrage in the U.S. Equities Market |
| stop-reason | Which invalidation fired: price, model, or time | Lets you audit “falling knife” avoidance |
| holding-time, heat-peak | Bars held and maximum adverse excursion | Tests whether time‑stops and bands are calibrated |
| roll-info (futures) | Front/next, roll date/time, basis | Prevents roll/expiry artifacts; always verify live specs |
Where the idea can fail#
- Regime misclassification: If your classifier tags a trending phase as mean‑reverting, you will fade sustained moves. Markov‑switching models help, but they are probabilistic and can be wrong at transitions A New Approach to the Economic Analysis of Nonstationary Time Series and the Business.
- Structural breaks in the residual: Relationships that supported stationarity (for example, pair linkage or factor exposures) can change abruptly; extreme z‑scores may reflect a new equilibrium. OU‑optimal policies widen bands under higher volatility or slower reversion speed, but that also reduces trade frequency Optimal Mean-Reverting Spread Trading: Nonlinear Integral Equation Approach.
- Costs and slippage: If you do not model execution frictions realistically, they can consume expected edge. Statistical‑arbitrage research emphasizes modeling costs rather than assuming constant fills Statistical Arbitrage in the U.S. Equities Market.
- Over‑aggressive extension: Very large absolute z‑scores may look attractive but often coincide with regime shifts or breaks; using OU‑derived bands and stop regions helps bound this risk Optimal Mean-Reverting Spread Trading: Nonlinear Integral Equation Approach.
What this four‑filter approach does well—and what it doesn’t
Strengths
- ✓Filters aim to reduce exposure to sustained trends by gating entries to mean‑reverting regimes (Source: A New Approach to the Economic Analysis of Nonstationary Time Series and the Business).
- ✓Model‑based bands help avoid chasing extreme outliers (Source: Optimal Mean-Reverting Spread Trading: Nonlinear Integral Equation Approach).
- ✓Liquidity gates and size controls tie the setup to realistic execution (Source: Statistical Arbitrage in the U.S. Equities Market).
Limitations
- —Regime and liquidity filters can reduce trade count and capital utilization.
- —Parameter error in reversion‑speed and volatility can distort optimal bands and lead to premature exits or missed entries (Source: Optimal Mean-Reverting Spread Trading: Nonlinear Integral Equation Approach).
- —Requires careful cost and execution modeling; naive fills can materially overstate results (Source: Statistical Arbitrage in the U.S. Equities Market).
- Strategy family: mean-reversion, stat-arb, pairs
- Signal type: residual-z, OU-band, factor-neutral
- Regime tag: regime-low-trend, regime-trend, regime-transition
- Extension bucket: z-2to3, z-3to4, z-gt4 (customize bins)
- Liquidity tier: liquid-A, liquid-B, illiquid-skip
- Stop type: stop-price, stop-model, stop-time
- Outcome: tp-hit, stop-hit, time-exit, flip-regime
- Futures admin: contract-code, expiry, roll-rule-verified
FAQ#
Is mean reversion just “buying dips”?
Pairs trading and modern stat‑arb research typically trade stationary residuals—spreads or de‑trended series—not discretionary dip‑buys. Many studies standardize the residual and use entry/exit thresholds tied to that series Statistical Arbitrage in the U.S. Equities MarketPairs Trading: Performance of a Relative-Value Arbitrage Rule by Evan Gatev, William N. Goetzmann, K. Geert Rouwenhorst :: SSRN.
Do I need a Markov‑switching model to run the regime filter?
No. Any regime classifier that measurably separates trending from mean‑reverting conditions can work. Markov‑switching models are a well‑established way to represent regime changes in economic and financial time series and are commonly used for such segmentation A New Approach to the Economic Analysis of Nonstationary Time Series and the Business.
How do I pick z‑score thresholds without overfitting?
Distance‑based pairs trading often uses standardized thresholds (for example, enter when the spread’s z‑score exceeds a level and exit near zero) Pairs Trading: Performance of a Relative-Value Arbitrage Rule by Evan Gatev, William N. Goetzmann, K. Geert Rouwenhorst :: SSRN. If you calibrate an OU model, you can compute optimal entry/exit bands that reflect your estimated reversion speed, volatility, and costs, reducing arbitrariness Optimal Mean-Reverting Spread Trading: Nonlinear Integral Equation Approach.
Can I use this on futures as well as equities?
Yes, if your residual is well‑defined (for example, between related contracts or versus a fair‑value basis) and you verify liquidity and contract specifications. Always confirm multipliers, tick sizes, and session hours with the exchange before testing or placing orders.
How should I handle costs and slippage in the backtest?
Backtests should include commissions and slippage. Statistical‑arbitrage frameworks explicitly incorporate cost modeling; ignoring execution frictions can materially overstate net performance Statistical Arbitrage in the U.S. Equities Market.
Why include a time‑stop if I already have price stops?
Time‑stops recognize that reversion probability decays when the estimated mean‑reversion speed is low or the regime shifts. OU‑based policies adjust optimal actions to those parameters; a simple time‑stop is a practical proxy Optimal Mean-Reverting Spread Trading: Nonlinear Integral Equation Approach.
Sources#
- Statistical Arbitrage in the U.S. Equities Market — jeremywhittaker.com
- A New Approach to the Economic Analysis of Nonstationary Time Series and the Business — citeseerx.ist.psu.edu
- Pairs Trading: Performance of a Relative-Value Arbitrage Rule by Evan Gatev, William N. Goetzmann, K. Geert Rouwenhorst :: SSRN — papers.ssrn.com
- Optimal Mean-Reverting Spread Trading: Nonlinear Integral Equation Approach — arxiv.org
KEEP READING

Strategies8 min read
How to test a trend-pullback strategy
Turn a vague pullback idea into a testable trend pullback strategy with measurable rules, ATR/Fibonacci options, and a reproducible backtest plan.
Read post
Strategies10 min read
VWAP strategy setups and when they fail
A practical VWAP strategy guide for intraday traders—three setups, explicit invalidation, and a reproducible backtest plan.
Read post
Strategies7 min read
Opening range breakout: rules, filters, and a test plan
A practical opening range breakout strategy guide: define range, triggers, invalidation, filters, and a falsifiable backtest before risking capital.
Read post