Filters & Regime Switches
Turning a strategy off in the conditions where it bleeds — a market filter as a circuit breaker.
A market filter (or regime switch) is a top-level rule that turns your strategy on or off depending on broad conditions — a circuit breakerAn automatic trading halt when prices move too far. that stops it trading in the environments where it reliably bleeds.
The insight builds on the volatilityThe size of price swings — not their direction.-regime lesson: most strategies have a natural habitat, and a filter keeps them out of the habitats where they get killed. TrendThe prevailing direction of price: up, down or sideways.-following thrives in trendingThe prevailing direction of price: up, down or sideways. markets and gets shredded in choppy ranges; mean-reversion thrives in ranges and gets steamrolled in strong trends. A regime filter — e.g. “only take long trades when the indexA basket of stocks tracked together to represent a market. is above its 200-day MAA line that smooths price into its underlying trend.” — acts as a master switch that sidesteps the conditions where the edgeA repeatable, structural reason your trades win over time. inverts. Done well, a single, robust filter can dramatically cut drawdowns by simply not playing when the odds are against you. But there’s a sharp warning: a filter is another set of parameters, so it’s a prime vector for overfitting — it’s tempting to add a clever filter that just happens to dodge the backtestTesting a trading strategy on historical data.’s worst patches (curve-fittingTailoring a strategy so closely to the past it fails on the future. the past’s specific pain). A good filter must have a real reason (this strategy genuinely fails in this regime) and survive out-of-sample, not merely flatter history. One simple, well-justified filter: good. A stack of finely-tuned filters: usually overfitting.
- What it does — a master on/off switch based on broad conditions (e.g. indexA basket of stocks tracked together to represent a market. above/below 200-day MAA line that smooths price into its underlying trend., volatilityThe size of price swings — not their direction. regime).
- Why it helps — keeps a strategy out of its hostile regime, often slashing drawdowns by simply not trading then.
- The danger — filters add parameters and are a prime overfitting vector; a filter that just dodges the backtestTesting a trading strategy on historical data.’s bad patches is curve-fittingTailoring a strategy so closely to the past it fails on the future..
- The rule — use few, well-justified filters with a real reason, validated out-of-sample.
ExampleA long-only momentumBuying recent winners and avoiding recent losers. strategy adds one filter: “only trade when the NiftyA basket of stocks tracked together to represent a market. is above its 200-day MAA line that smooths price into its underlying trend..” In bull regimes it runs normally; in sustained bear markets it goes flat, sidestepping the brutal momentumBuying recent winners and avoiding recent losers. crashes. DrawdownThe worst peak-to-trough fall in a portfolio. drops sharply for a simple, well-reasoned rule. Contrast adding ten oddly-specific filters that happen to skip exactly 2018 and 2022 — that’s overfitting, not robustness.
Key takeawayA regime filter is a master on/off switch that keeps a strategy out of the conditions where it bleeds (e.g. trade longs only above the 200-day MAA line that smooths price into its underlying trend.), often cutting drawdowns sharply. But filters add parameters and invite overfitting — use few, well-justified ones with a real reason, validated out-of-sample.
FAQs
How do I know if a filter is genuine or overfitting?
Ask whether it has an *economic/behavioural reason* (this strategy truly fails in this regime) and whether it works *out-of-sample* and across many markets — not just whether it improves the historical curve. A filter that only avoids your backtest’s specific bad periods, with no general rationale, is almost certainly curve-fitting. One robust filter beats many tuned ones.