Quantitative methods · Beginner · Weekly check
HMM Regime Detector
How it works, and when it doesn't.
Each asset being above its SMA(200) has 62% positive forward 3-month return probability. Running 5 uncorrelated assets reduces portfolio volatility by ~40% vs single-asset trend following.
Holding SPY
HMM(3-state) current state: Bear (5 days). Price 759.8 above SMA200=728.7. 63d return=-2.1%. Short. State probs: {'Bear': 1.0, 'Bull': 0.0}
Why it works
The 200-day SMA is the most widely watched trend indicator among institutional investors. Running it across 5 uncorrelated assets (SPY, TLT, GLD, EEM, IEF) provides diversified trend exposure. When multiple uncorrelated assets are above their 200-day SMA simultaneously, it signals a broad risk-on environment with diversified trend confirmation.
The signal logic
- Check if SPY, TLT, GLD, EEM, IEF are each above their SMA(200)
- Hold equal weight in each qualifying asset
- ML hierarchical risk parity adjusts weights using volatility forecasts
- Rebalance weekly as assets cross their 200-day SMA
- Cash if no assets qualify
When it fails
2022 — the Fed's aggressive rate hikes caused SPY, TLT, and EEM to drop below their 200-day SMAs simultaneously.
- Best market
- Multi-year bull markets with broad participation across equity, bond, and commodity classes
- Worst market
- Rate shock environments where bonds and equities decline together
Backtest
| Sharpe ratio | 0.52 |
| Annual return | 6.4% |
| Worst drawdown | -9.3% |
| Trades in the backtest | 2 |
Backtest on daily bars, positions taken the bar after the signal (no look-ahead). Few trades: treat the ratios as anecdotal.
HMM Regime Detector, live.
Re-scored after every close.
The platform runs this and 32 other strategies against the live tape each day — with the evidence behind every number.