Detecting Market Regimes with Hidden Markov Models for Intraday Trading
Markets switch between unobservable "regimes" that leave behind statistical patterns you can exploit.
Markets don’t just move—they shift. Sometimes they trend, sometimes they range. Recognizing these shifts in real time is a key advantage for any intraday trading system. Hidden Markov Models (HMMs) are well-suited to this task. They model markets as switching between unobservable "regimes" that leave statistical fingerprints in return series.
In this study, I use a simple 3-state Gaussian HMM to classify intraday market regimes (uptrend, downtrend, sideways) using only 5-minute return bars. We avoid technical indicators, economic data, or fundamentals. The goal is to test whether a clean price-driven signal can produce actionable regime classifications. It can.
Tested on intraday price data from the largest U.S. stocks between early April and early June 2025, the resulting regime-based strategy achieves a daily Sharpe ratio of 5.9—despite relying only on returns and minimal assumptions. Too good to be true? Maybe. But it shows that short-horizon return dynamics, filtered through a probabilistic lens, can reveal structure that traders often overlook.
Why Hidden Markov Models?
A Hidden Markov Model is a probabilistic model where the system being modeled is assumed to follow a Markov process with unobservable ("hidden") states. In financial contexts, HMMs help identify latent market conditions that influence observable price changes.
HMMs model systems where you observe outcomes (like price returns) but the underlying state (market regime) is hidden. Each regime generates returns with its own statistical profile. The model estimates:
Transition probabilities between regimes
Emission probabilities of returns within each regime