Alina Khay

Alina Khay

Share this post

Alina Khay
Alina Khay
Detecting Market Regimes with Hidden Markov Models for Intraday Trading

Detecting Market Regimes with Hidden Markov Models for Intraday Trading

Markets switch between unobservable "regimes" that leave behind statistical patterns you can exploit.

Alina Khay's avatar
Alina Khay
Jun 08, 2025
∙ Paid
11

Share this post

Alina Khay
Alina Khay
Detecting Market Regimes with Hidden Markov Models for Intraday Trading
Share

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

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 Alina
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share