Page 1 of 1

Hidden Markov models for market regimes: the look-ahead trap hiding in the smoothed probabilities

Posted: Tue Nov 24, 2026 4:10 pm
by Shadow Trader
Hidden Markov models come up a lot in regime discussions. The idea is appealing: the market switches between a few unseen states, say quiet-and-ranging and volatile-and-trending, each with its own return distribution, and the model infers from price which state you were probably in. Fit one to a year of M15 returns and plot the states over the chart, and it usually looks impressively sensible.

That picture is where the trap is. The standard fitting routine produces smoothed probabilities, which use the whole sample, past and future, to decide what state each bar was in. That's fine for describing history. It's look-ahead if you then use those states as a trading filter, because on the live bar you only have the past. The honest quantity is the filtered probability, which uses data up to the current bar only, and it's much noisier and slower to flip than the smoothed version that made the chart look so clean.

A few other points worth knowing:

- The number of states is a choice, and more states always fit the history better. Two or three is usually where people stop for good reason.
- The model is refitted on new data, and the parameters, and even which state means what, can shift between fits. Labels like "state 1 = trending" need rechecking each time.
- Regime detection is always a bit late. By the time the filtered probability is confident, part of the regime has passed.

None of that makes HMMs useless. As a volatility-regime gauge for sizing, the lag matters less than it does for entries. But any backtest using regime labels should state clearly whether they were filtered or smoothed.

Has anyone compared filtered versus smoothed regime filters in the same backtest? The gap between the two results would say a lot.