Machine learning · Advanced · Weekly
MLP Price Prediction
How it works, and when it doesn't.
Markets spend ~70% of time in Bull, 20% in Transition, 10% in Bear. Transition → Bear shifts are detectable early, allowing defensive positioning before the worst drawdowns.
MLP probability=52% — uncertain range. No trade.
Why it works
A 3-state Hidden Markov Model (Bull/Transition/Bear) models the latent regime governing price returns. The Viterbi algorithm decodes the most likely current state, while Baum-Welch EM optimizes the model parameters from data. The key insight is that regime transitions are predictable 2-3 weeks in advance.
The signal logic
- 3-state HMM fitted to SPY returns using Baum-Welch EM
- Current state decoded via Viterbi algorithm
- Long in Bull state (full size)
- Short in Bear state (hedge or reverse)
- Watch in Transition state (reduce size 50%)
- State posterior probability used as confidence
When it fails
HMM assumes stationary transition probabilities. Structural breaks (COVID, 2008) create new regime dynamics not present in historical data.
- Best market
- Markets with clear persistent regimes (2020-2021 extended bull, 2022 extended bear)
- Worst market
- Markets that flip between regimes rapidly (2015-2016 choppy markets)
Backtest
| Sharpe ratio | 0.41 |
| Annual return | 3.8% |
| Worst drawdown | -15.5% |
| Trades in the backtest | 218 |
Backtest on daily bars, positions taken the bar after the signal (no look-ahead).
MLP Price Prediction, 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.