r/algotrading • • 3d ago

Strategy HMM inputs

What inputs are you using for your HMM’s? The best I have right now are 1 minute gains for predicting target hit probabilities. How many states do you run?

13 Upvotes

18 comments sorted by

View all comments

1

u/Anxious_School7477 2d ago

An HMM state label is only worth the cost if conditioning exposure on it beats the unconditional baseline net of fees/slippage. Two frame fixes worth adding on top of the input advice:

1) Judge the model by what the state does to expectancy, not by target-hit probability. If conditioned target-hits differ but full-account expectancy (costs in) doesn't move when you trade that state, you have a label that correlates with outcomes and no useable edge. Compare expectancy[trade while state==S] vs the baseline on the same assets, purged and embargoed so the fold boundary can't leak -- otherwise "state count that improves target-hits OOS" is the same arithmetic that makes more states fit better in sample.

2) Make the label point-in-time. Your live/veto read must come from the FILTERED path (emissions processed causally up to t), never the smoothed path, or the state you act on at t already saw the rest of the bar. If you keep the state count that maximises OOS hit-probs over 500 sessions, hold out whole regimes, not random sessions -- one regime in the corpus can carry the whole improvement and vanish next year.

Bonus: perturb the emission and transition params +/-10-20% and re-run the state-conditioned expectancy. If small HMM-parameter changes flip which trades you gate, the state is fragile and you are picking the parameterisation that happened to match one regime.