Most strategies work in some conditions and not others. A regime filter is a rule that turns a strategy on only when the market is in the condition it needs.
Common regime measures
- Trend: slope of a long moving average, or price above or below it.
- Volatility: ATR relative to its own longer average; high or low volatility regimes.
- Session: regular hours versus overnight; first hour versus midday.
- Events: days with or without major releases.
Example (hypothetical)
A mean-reversion strategy buys short-term dips. The hypothesis says it should work in quiet, range-bound conditions and fail in strong trends. Filter: "Trade only when 20-day ATR is below its 100-day average and the 50-day moving average's 10-day slope is within a small band around zero."
Testing a filter honestly
- State the reason first. A filter justified by the strategy's logic is less likely to be a fluke than one found by searching.
- Compare filtered and unfiltered results on the same data, net of costs.
- Check the filtered-out trades. If they're clearly worse, the filter is doing its job; if they're similar, it isn't.
- Test out of sample (later lessons). Filters are a classic source of overfitting: there's always some combination that removed the past's worst trades.
Regimes change without warning
Regime measures are calculated from past data, so they recognize a change after it happens. Expect some losses at every regime transition.
Takeaways
- Regime filters switch a strategy on in the conditions it needs.
- State the reason before testing, and check what the filter removes.
- Filters overfit easily; test them out of sample.
Common misconceptions
- "A filter that removes the worst trades is good." It may have been chosen because it removes those particular past trades.
- "Regimes are obvious in real time." They're clear in hindsight.