The HMM regime is a necessary but not sufficient condition for entry. Eight technical confirmations act as a second filter — requiring that the micro-structure also supports a long trade before committing capital.
Price chart with RSI
RSI (Relative Strength Index) measures momentum over a 14-bar window. Values above 70 signal overbought conditions; below 30 signals oversold. Our rule is simply RSI < 90 — we want momentum, just not dangerous extremes.
Synthetic BTC price (120 bars)
RSI (14) — dashed lines at 70 and 30
The 8 technical confirmations
At the latest bar, evaluate all 8 conditions. Entry requires 7 or more to pass. Click "Evaluate latest bar" to check the current state of the synthetic series.
⏳
RSI < 90
Not dangerously overbought. Allows strong uptrends while catching tops.
⏳
Positive Momentum
Close[t] > Close[t−10]. Price is higher than 10 bars ago.
⏳
Volatility OK
ATR > 0.5% of price. Sufficient movement to make a leveraged trade worthwhile.
⏳
Volume Surge
Volume > 110% of 20-bar average. Conviction behind the move.
⏳
ADX > 25
Average Directional Index confirms a strong trend (not just noise).
⏳
Above EMA(50)
Price is above the 50-bar exponential moving average — bullish structural bias.
⏳
MACD Bullish
MACD line > signal line. Short-term momentum exceeds long-term trend.
⏳
OBV Rising
On-Balance Volume slope positive over 5 bars — money flowing into the asset.
Raw HMM regime assignments can flicker between states on noisy boundary bars. Hysteresis requires the same regime to appear for 3 consecutive bars before we accept it as confirmed.
Regime hysteresis state machine (3-bar lag)
Signal hysteresis in the code. We track a pending_regime and a counter. Each bar where the raw HMM output matches the pending regime increments the counter. Only when counter ≥ 3 do we update confirmed_regime. The 48-hour cooldown after any exit is a separate, harder constraint — once triggered, no entry is possible regardless of signals.
Leverage and the 48-hour cooldown
2.5× leverage. Applied to strategy returns: if the underlying asset gains 1%, the strategy gains 2.5%. Leverage amplifies both wins and losses. Combined with the regime filter (only entering Bull Run) and 7/8 confirmation gate, the goal is high-quality entry timing to justify the amplified risk.
48-hour cooldown. After any exit (whether from regime flip or stop-loss), the strategy enters a hard lock. No trades are permitted for 48 bars (hours). This prevents immediately re-entering after a whipsaw, and ensures the model re-evaluates the environment before committing capital again.
Exit rule. Position is closed immediately when confirmed_regime transitions to 'Bear/Crash'. No price-based stop-loss is used — the regime itself is the exit signal. This keeps the strategy in harmony with the model's view of the market.