How Quants Predict the Market's With Markov Models (Full Framework)
We are going to break down how quant desks use a piece of 120 year-old math to know when the market is about to change character before the chart shows it & share the exact framework you can run on your own strategies today.
Let's get straight to itβ¦.
Bookmark this. We are the team behind Horizon, the first agentic trading platform: you type a trading strategy in plain English, backtest it in minutes, and deploy it live to your broker. Writing a regime condition into your strategy is a one-sentence job here. Currently in closed beta, launching publicly on July 15. Join the waitlist at horizon.trade or DM @horizon_trade_x for early access.
Here is the roadmap:
The prediction quants actually make
Let's kill the myth first, because it is the payoff of this whole framework. Nobody on a desk predicts tomorrow's price. The prediction that works is one level up: what state is the market in, and how likely is that state to change. Markets spend long stretches in recognizable characters: a quiet grind higher, a violent selloff, a directionless range, and each character rewards a completely different strategy. Read the state correctly and an ordinary strategy prints. Misread it and a brilliant strategy bleeds. The 120-year-old math is a machine for reading the state.
Markov chains in plain terms
The math is Andrey Markov's, published in 1906, and his idea fits in one sentence: the probability of the next state depends only on the current state. Weather makes it intuitive. If today is sunny, there might be an 80% chance tomorrow is sunny and 20% it rains. If today rains, maybe 60% it rains again. Write those numbers in a small table, the transition matrix, and you can compute the long-run behaviour of the entire system from that table alone.
Swap sunny and rainy for market regimes, trend, chop, panic, and two properties of fitted market models do the heavy lifting.
Regimes are sticky. The most likely next state is almost always the current state. Volatile markets tend to stay volatile, quiet markets tend to stay quiet. This is why volatility clusters, and it means today's regime carries real information about tomorrow.
Transitions are asymmetric. The daily probability of jumping from calm to panic is small, but the jump happens fast when it comes. The road back from panic to calm is a slow grind over weeks. The matrix captures this asymmetry as numbers, which is something a moving average will never give you.
The catch: you cannot see the state
Weather is observable. Market regimes are hidden. Nobody rings a bell when trend turns into chop, and you only see the outputs: returns, volatility, volume.
This is where the Hidden Markov Model comes in, and it is the version desks actually run. An HMM assumes the true state is invisible and infers it from what you can observe. Feed it a return series, tell it how many regimes to look for, and it hands back two things: the transition matrix between the hidden states, and a live probability that the market sits in each state right now.
That probability updates every bar. Yesterday it read 85% quiet trend. Today, after a 4% down candle on rising volume, it reads 55%. The regime call flips days before your drawdown would have forced the same conclusion on you.
How desks run this on live money
Almost nobody trades the HMM output directly. It runs as a layer on top of existing strategies, in three standard patterns.
Switching. Trend-following runs while the model reads a trending regime. When probability shifts toward chop, the trend book winds down and mean reversion takes over. Each strategy only ever trades the environment it was built for.
Sizing. Exposure scales with regime confidence. Full size at 90% probability of a favourable state, half at 60%, flat below that. The on-off decision becomes a smooth curve instead of a coin flip.
Kill switch. Some desks use it purely for risk. When the probability of the panic state crosses a threshold, gross exposure gets cut, regardless of what every individual signal says.
Look at the current tape, and you can see why this layer earns its keep. Bitcoin printed a 21-month low, bounced back above $60K, and the entire timeline is arguing about whether the regime has turned. A desk with a fitted HMM reads a probability while everyone else reads opinions.
Where Horizon runs this
You do not need to fit an HMM yourself to trade this way. In Horizon, you describe the regime logic in plain English, and the backtest shows what it is worth. This is the entire input:
The pair of runs below is real. A Donchian breakout on BTC that kept shorting into the long-term uptrend finished at -50.68%, with an 81% max drawdown and the short book alone bleeding $75,836
The same idea rebuilt for its regime, long only with a volatility condition written as one sentence, finished at +41.15%. Reading the regime wrong was most of the difference, and the rebuild took minutes, without a line of code.
How traders get this wrong
Three failure modes cover almost every blown implementation. Adding states: five regimes fit the past better than two and predict the future worse, so desks stop at two or three and validate out of sample. Expecting tops: an HMM needs several bars of evidence before probabilities move, so it will never sell the exact high, and its actual job is catching the transition weeks before your equity curve does. Fitting once: a model trained on 2020 to 2023 learned regimes shaped by zero rates, and without refitting on a rolling window the matrix goes stale. Respect those three, and a 120 year-old idea will read the market's character better than your feed does.
Thanks for reading.
Before you go. We are the team behind Horizon, the first agentic trading platform: you type a trading strategy in plain English, backtest it in minutes, and deploy it live to your broker. The regime rebuild you saw above took one sentence and a few minutes here. Currently in closed beta, launching publicly on July 15. Join the waitlist at horizon.trade or DM @horizon_trade_x for early access.





