Hidden Markov Model (GaussianHMM) with 3 states and 4 emission features (log-return, realized volatility, volume ratio, ATR percentile). Retrained weekly on rolling 252-day window. Signal gate: only the correct signal type is allowed to fire in each regime.
Positive drift, low-medium volatility, normal volume.
Only BUY signals allowed.
Negative drift, high volatility, elevated volume (panic).
Only SELL signals allowed.
Near-zero drift, low volatility, low volume.
Only STRONG signals pass. Position size halved.
Model: GaussianHMM — hmmlearn library, covariance_type='full'
States: 3 (labeled by mean log-return: lowest=BEAR, middle=SIDEWAYS, highest=BULL)
Emission features (4): daily log-return, realized volatility (20d), volume ratio, ATR percentile rank (90d)
Training: Rolling 252-day window of daily data, retrained weekly (Sundays)
Inference: Viterbi decoding — most likely hidden state sequence
Why 4 features? Bull and Sideways both have low volatility — adding volume ratio and ATR percentile allows the model to discriminate between them.
Note: Current regime data is displayed on the Live Signals page (regime tag on each signal card). Full state probability time-series will be available in Phase 2 with real-time charting.