Filtering Trend-Following Trades with HMM Volatility Regimes
Summary
The article outlines a workflow for adding a Hidden Markov Model (HMM) volatility filter to a moving-average trend-following strategy. It defines volatility as the standard deviation of returns over a rolling window, classifies observations into high and low volatility states, and proposes entering only when the model forecasts a high-volatility state. The implementation spans a MetaTrader 5 strategy and data collection, Python model training, and reintegration for backtesting.
The conceptual explanation covers hidden states, transition probabilities, emission distributions, and inference of likely regimes from observed data. The article describes a backtest but the supplied text gives no performance figures or detailed evidence to assess the strategy. It also identifies an important limitation: the rolling volatility observations and the high/low states are closely related, so the model's apparent predictive value may be weak and a direct volatility filter might behave similarly. The Markov assumption may also fail when market regime changes depend on longer histories. Alternative state definitions and more than two regimes are suggested for further investigation.
Key ideas
- An HMM infers unobserved market regimes from observed price or return data.
- The proposed filter forecasts high or low volatility states using rolling return volatility.
- The strategy takes moving-average crossover signals only when high volatility is forecast.
- The article describes an end-to-end implementation and backtest workflow but supplies no performance results in the provided text.
- Correlated volatility observations and state labels may limit the filter's predictive significance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.