All posts

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

A price chart dips below an average line and then reverts back toward it.

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”#

A candlestick price series dips below a smooth average line and later returns to it.
Illustrative concept: a price path deviates from, then reverts toward, a statistical mean. This is not a signal or recommendation.
FilterPurposeExample testable ruleLiterature anchor
RegimeAvoid trading reversion during persistent trends or regime transitionsOnly 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
ExtensionDefine “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 zeroDistance/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
LiquidityControl execution and slippage riskRequire minimum daily dollar volume and a maximum bid‑ask spread; adapt size to execution qualityTrading cost modeling is integral to stat‑arb design Statistical Arbitrage in the U.S. Equities Market
InvalidationForce outliers to be recognized quicklyUse a hard stop if the adverse z‑score breaches a stop threshold, or a model‑derived stop region; add a time‑stop if reversion stallsTransaction 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):

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?):

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”):

Entry, exit, and invalidation hypotheses#

From rules to a test: plan and instrumentation#

  1. 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.
  2. 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.
  3. Standardize to a z‑score and precompute realized volatility per asset or residual. Log both raw and winsorized values for diagnostics.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. 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 / tagDefinition you will logWhy it matters
regime-stateDiscrete state and its probability at entry/exitVerifies regime‑gating logic A New Approach to the Economic Analysis of Nonstationary Time Series and the Business
z-at-entry, z-at-exitStandardized residual at decision timesConfirms 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-sigmaRolling OU reversion‑speed and volatility estimatesExplains shifting optimal bands and failures Optimal Mean-Reverting Spread Trading: Nonlinear Integral Equation Approach
liquidity-pass, spread-bps, dollar-volumeLiquidity snapshot used for eligibility and sizingLinks results to execution quality Statistical Arbitrage in the U.S. Equities Market
costs-per-share or per-contractCommissions and slippage assumptions usedKeeps net P&L comparable and realistic Statistical Arbitrage in the U.S. Equities Market
stop-reasonWhich invalidation fired: price, model, or timeLets you audit “falling knife” avoidance
holding-time, heat-peakBars held and maximum adverse excursionTests whether time‑stops and bands are calibrated
roll-info (futures)Front/next, roll date/time, basisPrevents roll/expiry artifacts; always verify live specs

Where the idea can fail#

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#

Your journal writes posts like this about you.

Connect a broker and TerraTrade turns your own trades into the findings that matter.