REG-10 · Regime Detection

HMM Regime Detection

Hidden Markov Model identifies latent market states (bull/bear). Uses Gaussian emissions and Baum-Welch for parameter estimation. Trades based on inferred regime.

RegimeMachine LearningStatistical

At a glance

Best onMarkets with distinct regimes
Signal frequencyDaily
Typical holding periodWeeks
Asset classesIndex, Commodity, FX
Markets tested10
Data through2026-11-10

What the backtest shows

  • Beat buy-and-hold on 3 of 10 markets by annual return over 5 years.
  • Had a smaller maximum drawdown than buy-and-hold on 8 of 10 markets.
  • Best market by Sharpe ratio: SPY (Sharpe 0.78, CAGR 7.5%).
  • Weakest market: DBA (Sharpe -0.06, CAGR -1.0%).

Equity curve

0.452.735.007.289.55 201020122014201620182020202220242026
HMM Regime Detection Buy & hold · SPY, 2010-01-04 → 2026-11-10, growth of 1

Score and risk profile

Arena Score: 74.8SPY, 5 years
Return quality · 30%85
Drawdown control · 25%77
Consistency · 20%63
Robustness · 15%52
Significance · 10%96

Each bar is a percentile against every strategy on the same market and window (100 = best).

How it held up in sell-offs (SPY)

PeriodStrategyBuy & hold
Q4 2018 sell-off-3.7%-19.2%
COVID crash (Feb–Mar 2020)-7.6%-33.7%
2022 bear market-8.4%-24.5%
Market above its 200-day average (annualized) · 81%+5.2%+12.5%
Market below its 200-day average (annualized) · 19%+9.6%+19.8%

Sell-off dates follow the US stock market. Above/below the 200-day average uses the previous day's position, so there is no look-ahead.

Out-of-sample check (SPY)

CheckValue
Chosen parameters on their 3-year training windows (average Sharpe)1.06
Same parameters in the following 6 months, when traded (Sharpe)0.81
Default parameters over the same months (Sharpe)0.93
Parameter re-selections / changes28 / 10
Parameter settings with a positive Sharpe (full history)9 of 9
Sharpe across settings: worst / median / best0.56 / 0.76 / 0.83

Out-of-sample periods start on 2013-01-04. Training-window figures are flattered by picking the best of 9 settings; the out-of-sample figure is what the strategy actually earned. A large drop, or a result that depends on one setting, points to overfitting. How walk-forward testing works.

Results by market (5 years)

MarketCAGRBuy & hold CAGRSharpeMax drawdownBuy & hold max DDVolatilityArena Score
SPYSPDR S&P 5007.5%11.6%0.78-14.8%-24.5%9.8%75
USOUnited States Oil Fund15.5%20.2%0.67-28.8%-36.2%27.5%79
GLDSPDR Gold Shares5.7%16.4%0.47-19.2%-28.3%14.4%40
UNGUnited States Natural Gas-1.1%-30.7%0.21-66.8%-93.3%45.6%80
ETH-USDEthereum0.9%-15.1%0.20-58.2%-79.0%38.2%65
SLViShares Silver Trust-2.6%15.2%0.07-52.5%-57.8%29.1%27
BTC-USDBitcoin-2.9%2.6%0.06-65.8%-75.9%28.2%34
EURUSD=XEUR/USD0.0%-0.7%0.03-12.4%-17.2%5.4%55
DBCInvesco DB Commodity Index-0.6%10.8%0.03-43.1%-27.3%14.1%24
DBAInvesco DB Agriculture-1.0%8.8%-0.06-22.4%-15.9%9.4%22

Strategy metrics use daily returns without trading costs. Buy-and-hold figures are for the same market and window. Rows are sorted by Sharpe ratio.

SPY across time windows

WindowTotal returnCAGRSharpeSortinoMax DDWin daysTrades
1 year+1.6%1.6%0.280.20-7.6%17%23
3 years+42.2%12.5%1.531.42-7.6%29%80
5 years+43.8%7.5%0.780.74-14.8%27%111
Full history+167.3%6.0%0.680.60-18.2%28%426

Rules

Entry

Buy when in bullish regime (higher mean state)

Exit

Sell when in bearish regime

Indicators

Returns as observations
HMM with Gaussian emissions
Infer most likely state sequence

Inputs

N_States = 2
Lookback = 252

Position sizing

Fixed 100% allocation

Risk controls

Regime probability threshold

Strategy evidence

Only available, validated bundles appear below. Missing evidence is not a passing validation result.

Evidence coverage

10 / 10 declared strategy–market pairs validated

Notes

  • Simplified HMM without external libraries
  • Uses rolling window for regime detection
  • Bull regime = positive mean returns, Bear = negative

Related strategies

Embed this score

Add the live badge to a blog post, README or forum signature. It updates with the daily data.

<a href="https://quantarenas.com/strategy/reg-10-hmm-regime-detection/"><img src="https://quantarenas.com/badge/reg-10-hmm-regime-detection.svg" alt="HMM Regime Detection Arena Score on Quant Arena" height="20"></a>
[![HMM Regime Detection Arena Score](https://quantarenas.com/badge/reg-10-hmm-regime-detection.svg)](https://quantarenas.com/strategy/reg-10-hmm-regime-detection/)

Backtests are historical simulations on daily data and do not include commissions or slippage. They do not guarantee future results and are not investment advice. See the methodology for how every strategy is tested.

Get the weekly Arena report

One email a week: ranking changes, new signals and new research. No spam; unsubscribe any time.