If you trade any kind of systematic strategy, you have probably noticed that the same system that works beautifully in a trending bull market can destroy your account when conditions shift. The strategy is not broken. The market is just operating in a different regime, and your system is not built to handle it.
Market regime filtering is one of the most practical tools a systematic trader can add. Done right, it reduces volatility significantly while giving up very little on the return side. Done poorly, it adds complexity without benefit. Cesar Alvarez has been applying regime filters across mean reversion, breakout, and momentum strategies for years, and in this episode he shares exactly how he does it.
Cesar is a specialist in quant-based trading strategies and the founder of Alvarez Quant Trading. If you have been following BST for a while, you will remember his previous appearances on the mean reversion series and his stop loss research. Today he goes deep on regime classification, the whipsaw problem, and why using multiple different regime filters at once is often better than picking just one.
Watch the full episode below, then read on for the complete breakdown.
What is a market regime filter and why do you need one?
A market regime filter is simply a mechanism that tells your strategy when conditions are favorable for trading and when they are not. The goal is to reduce the volatility of your returns while having minimal impact on your overall profitability.
Cesar’s background with Larry Connors at Connors Research gave him an early grounding in this concept. The basic version most traders know is the 200-day moving average: trade long when price is above it, step aside when it is below. That single rule is where most traders stop. Cesar has gone considerably further.
The practical case for regime filters becomes obvious in bear markets. Mean reversion strategies do technically continue to work when the market is falling, but the volatility spikes so sharply that most traders would stop trading the strategy anyway, or they ride out drawdowns that are psychologically (and financially) unsustainable. A regime filter resolves this by reducing your exposure before the worst periods arrive, not after.
The 2008 lesson: why this matters in practice
Andrew got his own education in market regimes the hard way. In 2008, he was trading mean reversion long strategies in both US and Australian markets, using leveraged CFDs. The strategy was sound. The market environment was not.
When the financial crisis hit, volatility shot up and stocks went into something close to freefall. He kept buying the dips. The strategy said to buy, so he bought. Without a regime filter in place, there was nothing to tell him that the conditions his system was built for had completely changed. The result was a painful and expensive lesson.
That experience is why regime filtering is, as he puts it, “quite dear to my heart.” It applies regardless of what market you trade or what time frame you use. Any strategy benefits from a sanity check on whether current conditions are actually suited to what the system is designed to do.
Three regime filters compared on a real strategy
To demonstrate how different regime filters affect the same strategy, Cesar tested his NASDAQ momentum strategy (which he calls Tech Comments) with three different filters applied. The results are interesting because, despite the filters being quite different conceptually, the long-run outcomes are surprisingly similar.
| Regime filter | Method | CAGR | Worst drawdown |
|---|---|---|---|
| 200-day moving average | Go long only when close is above the 200-day MA on the S&P 500 | 26.8% | 31.7% |
| 126-day rate of change | Go long only when the 6-month return on the S&P 500 is positive | 26.1% | 27.1% |
| 252-day percent rank | Go long only when today’s close ranks in the top half of the past year’s closes | Similar | Similar |
The aggregate CAGR numbers are close across all three. But the year-by-year breakdown reveals meaningful differences. In 2008, for example, the three filters produced quite different outcomes. In 2020, two of them were almost identical at 47%, while the ROC-126 version came in at 28%. In 2017, all three produced almost exactly the same return.
This is the key insight from the comparison: the long-run performance is broadly similar, but the path to get there is different. When one filter has you sitting out, another might have you in. When one has you in too early or too late during a transition, another might be on the right side of the trade.
The whipsaw problem and how to think about it
The biggest challenge with any regime filter is whipsaw. The market crosses your threshold, you get out. Then it reverses, you get back in. Then it crosses again. Each transition costs you something, either in missed trades or in exit and re-entry friction.
The instinct is to try to optimise the parameter to avoid this, perhaps switching from a 200-day to a 180-day or a 250-day average in an attempt to reduce the number of crossings. Cesar’s view is that this kind of parameter tuning misses the point.
The regime filter is a coarse tool. You are not trying to time the market perfectly. You are trying to avoid the genuinely bad periods. A few whipsaws in borderline conditions are the cost of protection during the extended bear markets that can genuinely damage a strategy. Spending a lot of effort to shave a few percentage points off the whipsaw cost is usually not worth it and introduces curve-fitting risk in the process.
How Cesar applies regime filters in practice
His preferred approach is to select a regime filter before building the strategy, not after. He picks one, installs it as a fixed component, and then develops the rest of the system around it. The filter is not part of the optimisation process.
Occasionally he will test one alternative parameter (going from a 20-day to a 100-day, for example), and if one is clearly better he will use it. But this is a single comparison, not a broad search. The idea is to treat the filter as a structural decision, not a tunable variable.
The reason this matters is that optimising your strategy parameters with and without a regime filter in place creates a problem. Strategies behave very differently in bull markets versus bear markets. If you optimise parameters while both regimes are in your data, the optimizer will find a value that is a compromise between the two, and that compromise is typically not very good for either. By locking in the filter first, your parameters only need to work in the market conditions where you intend to trade.
Why multiple regime filters across a portfolio is often better
The year-by-year comparison above points to something valuable: different filters get you in and out at different times. If you are running multiple strategies, having those strategies use different regime filters adds another layer of diversification to your portfolio.
Cesar uses this deliberately. His mean reversion, breakout, and momentum strategies all carry regime filters, and those filters are not all the same. The result is that the portfolio is never entirely shut down by a single filter signal, and the transitions between regimes are smoother because different strategies respond to conditions at slightly different times.
He noted that two of his strategies do not use regime filters at all. One is a short strategy that works in both bull and bear markets, and the other is a volatility strategy with similar properties. For those, a regime filter would only reduce performance. The point is to apply the tool where it adds value, not as a blanket rule.
Classifying regimes: what to look for beyond moving averages
The 200-day moving average is the most common regime filter, but Cesar uses several approaches depending on the strategy:
- 200-day moving average on the index: Close above the MA signals bull market; close below signals bear. Simple and widely used.
- 126-day rate of change: If the S&P 500 has produced a positive return over the past six months, conditions are favorable. Negative six-month return means step aside.
- 252-day percent rank: Take the past year of closing prices and rank them. If today’s close falls in the top half of that distribution, you are in a bull market. Bottom half signals bear.
What is striking from his testing is that all three approaches produce similar long-run results despite being conceptually distinct and using different lookback periods (200 days, 126 days, and 252 days respectively). The divergence shows up in individual years, not in the full-period aggregate. That robustness across different measurement approaches is itself evidence that the underlying phenomenon, market regimes, is real and worth filtering for.
Related episodes
- Building Mean Reversion Trading Strategies with Cesar Alvarez (Part 1)
- Consistent equity growth through diversification with Nick Radge
- 6 ways to detect a failing trading strategy with Kevin Davey
- How to optimize strategies for robustness with John Ehlers
Want to trade smarter with better market timing? Subscribe to the Better System Trader podcast for weekly interviews with the world’s top systematic traders and quantitative researchers.

