Get pinged when your stocks flip

We'll only notify you about YOUR stocks — when the trend flips, hits stop loss, or hits a target. Never spam.

Install TrustyBull on iPhone

  1. Tap the Share button at the bottom of Safari (the square with an up arrow).
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add in the top-right.

What is Regime-Based Backtesting — Testing Bull and Bear Markets Separately?

Regime-based backtesting splits historical data into bull, bear, and sideways periods, then judges a strategy on each separately. It is the most useful upgrade in any honest guide to how to build a trading system, exposing strategies that only work in one regime.

TrustyBull Editorial 5 min read

Most trading systems that look profitable across 10 years of data are mostly fitting one market regime — usually a bull market. Backtest the same system separately on bear and sideways periods, and around 70 percent of strategies fall apart. Regime-based backtesting is the discipline of slicing your historical data by market state and judging the system on each slice independently. It is the single most useful upgrade in any honest guide to how to build a trading system.

The technique exposes the most expensive bias in retail strategy design: assuming the future market looks like the average of the past, when in reality the future will be a sequence of distinct regimes that each behave differently.

What regime-based backtesting actually means

A market regime is a stable behavioural state that lasts months or years. The most common categories used in backtesting are:

  • Bull markets: sustained uptrends with rising 200-day moving averages.
  • Bear markets: sustained downtrends with falling 200-day moving averages.
  • High-volatility sideways: indices oscillate widely without a clear trend.
  • Low-volatility sideways: indices grind in narrow ranges with shrinking volatility.

Standard backtesting throws all four into one stew and reports a single number — say, an annual CAGR of 18 percent. Regime-based backtesting reports four separate numbers, one for each state. The four numbers almost always tell a more honest story.

Why this matters for how to build a trading system

A system that looks great on a single number can hide three serious flaws.

First, an outsized bull-market gain can mask flat or losing performance during bear and sideways years. The combined number averages out the pain.

Second, drawdown timing matters. A system that loses 30 percent in a bear regime, then recovers in the next bull, looks acceptable on aggregate but is unbearable in real life because most traders quit during the loss.

Third, regime persistence is uneven. Bull markets in India have run 4 to 7 years recently. Bear markets have lasted 6 to 18 months. A backtest that includes one bear period and three bull periods is heavily biased toward bullish conditions.

How to define market regimes cleanly

You do not need fancy machine learning to label regimes. Three simple rules cover most of the work.

  • 200-day moving average direction. Up = bull, down = bear, flat = sideways. Decide "flat" by a slope threshold, like 1 percent over 30 days.
  • Rolling 60-day volatility. Above its long-run median = high vol. Below = low vol. Combine with the trend label to get four regime states.
  • Drawdown from rolling peak. Drawdowns above 15 percent automatically tag the period as a bear regime, regardless of what the moving average says.

Apply these rules to historical data once, then run the strategy with regime tags attached to every trade. The output is a per-regime equity curve and metrics: win rate, average trade, maximum drawdown, Sharpe ratio.

A simple example of regime-based testing

A trader designs a momentum strategy that buys the top 10 stocks each month based on six-month returns. Across 2010 to 2024, the strategy shows a 19 percent CAGR — impressive on paper.

Split by regime: bull markets show 32 percent annual returns. Bear markets show -14 percent. Sideways markets show 4 percent. The strategy is essentially a bull-market amplifier.

The improvement is obvious. Add a simple regime filter: trade the strategy only when the index 200-day moving average is rising. Adjusted CAGR drops to 16 percent, but maximum drawdown falls from 38 percent to 11 percent. The risk-adjusted return is dramatically better.

Notice what the regime test exposed. The headline 19 percent CAGR was real, but it came with regime-dependent drawdowns most retail traders cannot stomach.

Common mistakes traders make in regime testing

  • Too few regime samples. If your data has only one bear market, the bear-regime statistics are unreliable. Use 15 to 20 years of data minimum.
  • Look-ahead bias in labels. Avoid using future drawdowns to label past periods. The labelling rule must use only data available up to that point.
  • Mixing daily and weekly logic. Decide your timeframe first, then design the regime classifier on the same timeframe.
  • Ignoring transaction costs per regime. High-volatility periods often have wider spreads and more slippage, which a clean backtest must include.

How to use regime backtesting in live trading

A clean workflow looks like this:

  • Run the strategy on full data and split metrics by regime.
  • Identify which regimes the strategy struggles in.
  • Either add a regime filter to switch the strategy off, or layer a complementary strategy that performs in the weak regime.
  • Track regime classification live, daily, with the same rules used in the backtest.
  • Review per-regime drawdowns quarterly, not annually, to catch silent failures earlier.

For raw historical index data and free downloads, the NSE publishes daily OHLC files going back decades. Combine those with rolling moving averages in any spreadsheet to label regimes yourself.

FAQs at the bottom

How many years of data are enough for regime testing? At least 15 years for Indian markets, ideally 20. Less than that and the bear-regime sample size becomes statistically unreliable.

Should every trader use regime-based backtesting? Yes for systematic strategies. Optional for purely discretionary approaches, though the logic still helps decide when to scale up or down.

Can regime classifiers be wrong in real time? Yes. Lagging indicators like the 200-day moving average always identify regime shifts after they begin. Combine them with shorter-term volatility filters for faster but noisier signals.

Is machine learning required for this work? No. Simple rules-based labels capture most of the value. Machine-learning classifiers add precision but also add overfitting risk for retail traders without robust validation pipelines.

Frequently Asked Questions

What is the difference between standard and regime-based backtesting?
Standard backtesting reports one combined number for the full history. Regime-based backtesting splits the history into bull, bear, and sideways periods and reports separate numbers for each, exposing where the system actually works.
How many years of data should regime backtesting use?
At least 15 years of Indian market data, ideally 20. Less than that does not contain enough bear-market samples to make per-regime numbers statistically meaningful.
Can regime backtesting be done without coding?
Yes, in a spreadsheet for simple strategies. Add a column for regime label based on the 200-day moving average direction, then split returns by that label.
Does regime backtesting eliminate overfitting?
It reduces but does not eliminate it. Out-of-sample testing on a held-back period and walk-forward validation are still required for any system meant for live use.
Should retail traders skip strategies that fail in bear regimes?
Not necessarily. They can be paired with a regime filter that switches them off in bear states, or with a complementary defensive strategy that handles bear conditions specifically.