Market Regime Detection
7-State Gaussian Hidden Markov Model trained on hourly BTC/USDT data from Binance (asset_id 587). States ordered by mean log return — State 0 most bearish, State 6 most bullish.
BTC Price Coloured by Regime

Regime Summary
| State | Label | Count | % Time | Ann. Return | Ann. Vol | Hrly Vol | Mean Range | Vol Chg | Sharpe |
|---|---|---|---|---|---|---|---|---|---|
0 | Grind Down | 772 | 4.41% | -85.24% | 92.03% | 0.0098 | 0.0218 | +0.529 | -92.6 |
1 | Capitulation | 2,831 | 16.16% | -23.71% | 25.34% | 0.0027 | 0.0070 | -0.007 | -93.6 |
2 | Mild Bear | 3,714 | 21.20% | -12.14% | 14.78% | 0.0016 | 0.0041 | -0.065 | -82.1 |
3 | Sideways | 2,704 | 15.43% | -1.73% | 49.18% | 0.0053 | 0.0102 | -0.217 | -3.5 |
4 | Mild Bull | 3,050 | 17.41% | +1.38% | 11.99% | 0.0013 | 0.0024 | -0.029 | +11.5 |
5 | Bull | 3,582 | 20.45% | +26.73% | 16.19% | 0.0017 | 0.0057 | +0.020 | +165.1 |
6 | Rally | 866 | 4.94% | +96.25% | 60.77% | 0.0065 | 0.0165 | +0.530 | +158.4 |
Ann. Return = Hourly log return × 8,760 · Ann. Vol = Hourly std × √8,760 · States sorted by mean return ascending
Regime Descriptions
Persistent grinding downtrend. Prices bleed lower slowly each hour.
- ·Consistent small negative returns
- ·Low intra-bar range (0.49%)
- ·Falling volume
Flash crashes and panic sell-offs. Wild price oscillations trending down.
- ·Massive intra-bar range (2.4%)
- ·High volume surges
- ·Wild price swings
Moderate negative drift. Typical correction phases or uncertain macro.
- ·Slightly negative mean return
- ·Moderate range (1.0%)
- ·Above-average volume
Consolidation. Near-zero returns, tightest range, lowest volume.
- ·Near-zero hourly return
- ·Tightest range (0.24%)
- ·Flat/falling volume
Moderately positive drift. Recoveries and early-stage uptrends.
- ·Positive mean return (+0.034%/hr)
- ·Moderate range (1.2%)
- ·Declining volume
Steady low-volatility uptrend. BTC climbs consistently. Sharpe of 165.
- ·Consistent positive returns
- ·Low range (0.66%)
- ·Decreasing volume (-38%)
Mirror of Grind Down. Strong persistent uptrend. Sharpe +158.
- ·Strongest positive mean return
- ·Low range (0.47%)
- ·Stable volume
How Hidden Markov Models Work
The Core Idea
A Hidden Markov Model assumes markets exist in a small number of unobservable hidden states. You cannot see the state directly — only its noisy effects in price and volume.
Gaussian Emissions — 3 Features
Training: Baum-Welch (EM)
Decoding: Viterbi Algorithm
Each bar is assigned a regime using the Viterbi algorithm — dynamic programming that finds the most probable hidden state sequence.