Skip to content
Get App

Everyone Says Market Regimes Fix Trading Strategies. I Tested It.

Does adding a regime detection layer improve trading strategies out of sample? Tested on 31 assets, 2,700 backtests: the effect is real in aggregate but no single config survives correction.

Key Takeaways

  • Regime switching improves strategies on average across the universe, but this is an aggregate effect.
  • No single regime-switching configuration can be confidently distinguished from luck after multiple-testing correction.
  • The simplest regime detector (200-day moving average) performed as well as or better than the complex HMM.
  • Poor regime classification can actively harm performance, so regime detection is not a free improvement.

What the video covers

  • Follows up a prior study of 131,000 backtests by testing whether regime detection improves momentum and mean reversion strategies out of sample.
  • Uses the same 31-asset universe (SPY, sector ETFs, gold, oil, bonds, Bitcoin, Ethereum, mega caps) from the previous project's database.
  • Baseline without regime layer: momentum averages Sharpe 0.07, mean reversion averages -0.23.
  • Compares four regime detectors ranked by complexity: 200-day moving average, volatility level, a naive return-sign label, and a Gaussian hidden Markov model refit on each training window.
  • An active look-ahead audit replaces the future with random noise on 20 random days; all 20 regime labels remained unchanged, showing no future peeking.
  • Runs 2,700 walk-forward backtests across 31 tickers, 10 strategies, four detectors and three usage modes, including a reversed-mapping control.
  • Finding one: three of four detectors, including the simple 200-day rule, show a statistically significant average improvement over no regime switching.
  • Finding two: zero of 2,400 individual variants survive strict multiple-testing correction, so no single recipe is provably non-lucky.
  • The simple 200-day moving average outperformed the fitted HMM (0.359 vs 0.265 average Sharpe improvement); the naive detector actively hurt both strategies.
  • Limitations acknowledged: overlapping correlated assets, no position sizing (on/off only), and failing correction does not mean the effect is absent.

Answers

Questions about this video

Does regime detection improve trading strategies according to this video?

On average, yes: three of four detectors, including a simple 200-day moving average, show a statistically significant improvement over no regime switching across the 31-asset universe. However, the speaker stresses this is an aggregate effect.

Can any single regime-switching configuration be trusted as a profitable strategy?

No. Of 2,400 individual variants tested, none survived strict multiple-testing correction, meaning none can be confidently separated from lucky results.

Why did the simple 200-day moving average beat the fitted hidden Markov model?

The simple rule produced a 0.359 average Sharpe improvement versus 0.265 for the HMM, suggesting added complexity did not pay for itself and may slightly reduce performance.

Full Transcript — Download SRT & Markdown

00:00
Speaker A
A while back, I posted a video where I ran 131,000 backtests on real stocks. Some of the comments raised the objection. Parameter sweeps aren't architecture. Nothing you tested actually detects a market regime and changes behavior because of it. It's
00:19
Speaker A
a fair thing to want tested and it's the right question because just add regime detection is the most common thing people say when a backtest disappoints them. So, let's actually settle it. This video is one thing and one thing only.
00:34
Speaker A
Does adding a regime detection layer on top of strategies that already survived my last study actually make them better out of sample or is architecture just a fancier word for over fitting? No teaser, no fake excitement. I'm going to
00:51
Speaker A
show you the exact number and then I'm going to show you why that number is more interesting than a flat yes or no.
00:58
Speaker A
Same 31 asset universe as the previous study. SPY, the sector ETFs, gold, oil, bonds, Bitcoin, Ethereum, the mega cap names. I pulled it straight from the old project's database. So, there's no cherry-picking a new universe that happens to make this look good and I'm
01:16
Speaker A
not testing 50 random strategies again. I went back to that 131,000 strategy study and asked which categories actually held up walk forward. Two did, momentum and mean reversion. So, those are the only two families in this video. Five momentum
01:34
Speaker A
configs, five mean reversion configs. I'm not inventing new strategies to make regime switching look good. I'm testing famous, boring ones. And on their own, without any regime layer, momentum barely breaks even. Average sharp 0.07.
01:51
Speaker A
Mean reversion is actually negative, minus 0.23. That's the bar. Anything that helps has to help these, starting from there. Four ways of asking what regime is the market in right now, ranked from dumbest to fanciest, on purpose, because the fancier one has to
02:09
Speaker A
beat the dumb one to earn its place in the video. Simplest possible. Is price above or below its own 200-day moving average? That's it. That's the floor.
02:20
Speaker A
Next, is volatility high or low right now, compared to its own recent history? Then a strawman on purpose, a naive detector that just asks, "Did today's return go up, down, or sideways?" No fitting, no math, just a raw label. And
02:36
Speaker A
the fancy one, a Gaussian hidden Markov model, actual regime switching math, the same family of model Hamilton used in 1989 to describe recessions, fit fresh on every single training window.
02:51
Speaker A
Here's the thing I actually care about you seeing. The color is the regime. Teal is good for momentum. Amber is good for mean reversion. Every single one of these labels only ever looks backward. A label on any given day only knows what
03:05
Speaker A
happened up to that day, never what happens after. To avoid look-ahead bias, I built an active test. For 20 random days, I take everything that happens after that day, and I replace it with random noise, a fake future. Then I ask
03:21
Speaker A
the detector for its regime label on that day again. If the label changes, the detector was cheating. It was peaking into the future. 20 out of 20 labels didn't move. Not probably fine.
03:33
Speaker A
Test it, and it held. 31 tickers, 10 strategies, four detectors, three ways of using a regime label. Trade only in the good regime, switch between the two strategies based on regime, or deliberately flip that mapping backwards as a control. Every
03:50
Speaker A
walk-forward split, every combo, 2,700 back tests in under a minute. Nothing here is a toy run.
03:59
Speaker A
Here's the honest answer, and it's two answers, not one, because it's two different questions.
04:05
Speaker A
Question one, on average, does switching based on regime actually help? Yes, three out of four detectors, including the dumb 200-day moving average, show a real statistically significant improvement over doing nothing. Not one lucky config.
04:21
Speaker A
Systematic across the whole universe with a P value so small you'd need to run this a billion times to see it by chance once. Question two, is there one exact recipe here you could go trade tomorrow? No, zero out of 2,400
04:38
Speaker A
individual variants survive a strict statistical correction for how many things I tried. Not one. Both of those are true at the same time. That's not a contradiction.
04:49
Speaker A
That's the actual finding. The idea works. No single instance of it is provably not luck.
04:56
Speaker A
Let me make that concrete, because it's the whole game. Imagine a casino with 2,400 slot machines.
05:04
Speaker A
You play everyone for a year. A handful come out ahead. Of course they do. That's just variance, not a broken machine.
05:13
Speaker A
Now, on average, do these machines pay out more when the light is green? Can be a real measurable yes, a genuine pattern across all 2,400.
05:24
Speaker A
While at the same time, is there one specific machine I can walk up to tomorrow and beat? Is no, because you can't tell the machine with a real edge apart from the one that just got lucky over your sample.
05:37
Speaker A
That's exactly what's happening here. The regime effect is real in aggregate. No single config is provably real on its own. Testing 2,400 things is what forces you to hold both of those in your head at once. And it's
05:53
Speaker A
the step almost nobody in this space does, which is why almost everybody thinks they found a machine when they found a lucky pull. And here's the part that should sting a little if you've ever bought a course promising you a
06:07
Speaker A
machine learning trading edge. The simplest possible detector literally is price above its 200-day average. Beat the fitted hidden Markov model. 0.359 average sharp improvement for the simple rule. 0.265 for the fancy math. The dumb rule won.
06:28
Speaker A
Complexity didn't just fail to pay for itself here. It cost a little. And the naive straw man detector, it didn't just fail to help. It actively made both strategies worse, which tells you something real. Regime detection isn't a
06:43
Speaker A
free lunch just because you slept the word regime on a script. Get the classification wrong, and you're not neutral. You're actively bleeding. I'm not going to pretend this is the final word. The 31 tickers overlap a lot. SPY
06:58
Speaker A
and QQQ and the sector ETFs move together. So, these aren't 31 fully independent tests. There's no position sizing here, just on or off. And no single variant survives correction doesn't mean the effect isn't real. It means no specific config on its own
07:16
Speaker A
clears an extremely high bar. That's a different more honest statement than this doesn't work. So, architecture or another mirage? Genuinely both, depending which question you ask. And I think that's a more useful answer than the clean yes, it works or no, it's all
07:33
Speaker A
fake headline you'd get from most channels in this space. Every cell in this notebook, the data fetch, the walk forward engine, the four detectors, the audit that proves there's no look ahead, all of it is sitting in the lab right now. The actual runnable
07:50
Speaker A
notebook, change the universe, change the strategies, change the detector, rerun it and see what you get. That's the AlgoVibes Research Lab, lab.wisequant.app.
08:01
Speaker A
Members vote on what gets tested next. And this is exactly the kind of is this actually true question I want more of in that queue. If this saved you from believing a regime switching pitch that's really just a moving average with
08:17
Speaker A
better marketing, that's the whole point of this channel. Thanks a lot for watching. Let me know what you are interested in below, and I see you in the next one.
Topics:regime detectionbacktestingwalk-forward analysisoverfittingmomentum strategymean reversionhidden Markov modellook-ahead biasquantitative tradingmultiple testing correction

Get More with the SozAI App

Transcribe recordings, audio files, and YouTube videos — with AI summaries and speaker detection. 30 minutes free.

Or transcribe another YouTube video here →