A regime filter is a rule that turns a strategy on or off based on a detected market state.
A regime filter is a rule that turns a strategy on or off based on a detected market state. In research, that sounds clean: only trade when the environment is favorable. But this is also a common place for hidden look-ahead to enter. If the state definition, threshold, or switching rule is selected because it improves historical results, the filter may be encoding information from the full sample rather than a decision process that would have been available in real time.
Sonar’s strategy-validation research frames this as a model-selection problem. The key issue is not only whether a filtered version of a strategy shows better in-sample metrics, but whether that improvement survives proper validation. Sonar’s validation guidance emphasizes out-of-sample testing, walk-forward style evaluation, and explicit checks for backtest overfitting because repeated testing and selective reporting can make a strategy appear robust when it is not. In that framework, a regime filter should be treated as a model choice that increases the search space and therefore raises the risk of selection bias and hidden look-ahead effects.
This matters because a regime filter often looks modest in code but large in degrees of freedom. A researcher may choose the state variable, the lookback window, the threshold, the persistence rule, whether the filter blocks entries or also forces exits, and whether different assets share the same state definition. Each such choice can be tuned against the same history. Sonar’s backtest-overfitting audit is designed for exactly this setting: evaluating whether observed backtest quality is consistent with genuine signal or more consistent with selection from many tried alternatives. Applied to a strategy with a regime filter, the audit provides a formal way to test whether the filtered variant’s apparent advantage is likely to be an artifact of the research process.
Sonar’s strategy-validation material also makes clear that in-sample improvement is not sufficient evidence. The right question is whether the regime‑conditioned strategy performs consistently on data not used to design the filter. If a filter boosts Sharpe ratio or reduces drawdowns only in the development sample, that is not validation; it is a warning sign. Out‑of‑sample testing is therefore a minimum requirement. When multiple filter specifications were explored, an overfitting audit becomes especially important because even a clean chronological split may understate the amount of selection that occurred during research.
A related issue is how performance is summarized after model selection. Sonar’s glossary entry on the deflated Sharpe ratio explains that a standard Sharpe ratio does not account for selection bias from trying many variants. The deflated Sharpe ratio adjusts for the fact that the reported strategy may be the best of many tested candidates, making it a more appropriate statistic after a research process that includes regime‑filter design. For a filtered strategy, a large gap between the ordinary Sharpe ratio and the deflated Sharpe ratio would indicate that the apparent quality of the result is materially reduced once multiple testing is considered.
That comparison is useful because regime filters are often added late in the research cycle, after a base strategy already exists. At that point, the filter can function as a selective wrapper around historical trades: keep the good periods, discard the bad ones. A conventional Sharpe ratio computed on that chosen variant can look persuasive while ignoring how many alternative definitions were examined before arriving at the final filter. The deflated Sharpe ratio is intended to correct that optimism by incorporating the effect of non‑normal returns and multiple trials into the interpretation of Sharpe‑based evidence.
A regime filter that switches a strategy on or off by market state should be presumed to add overfitting risk, not presumed to add robustness. It should be validated on out‑of‑sample data and, where multiple candidate filters or thresholds were explored, subjected to a dedicated overfitting audit. Performance should also be interpreted with selection‑aware statistics such as the deflated Sharpe ratio rather than standard Sharpe alone.
Covered in depth in the Strategy validation & overfitting pillar hub.