Skip to content
All library documents

Using a Gaussian Hidden Markov Model to Filter Moving-Average Trades

Article QuantInsti blog

Summary

This project uses a Gaussian Hidden Markov Model to classify market conditions as high or low volatility, then applies those classifications to a moving-average crossover strategy. Daily returns serve as the observable input, although the author also suggests standard deviation or volatility as alternatives. The model is trained on one portion of the data and evaluated on held-out observations; the strategy avoids entering when predicted volatility is high and exits an existing position when high volatility is detected.

The comparison uses 120 days of intraday data across Indian index and equity tickers, split evenly between training and testing because the sample is small. The author reports that regime filtering reduced losses for several securities and turned one losing result positive, while some better-performing unfiltered results earned less with the filter. The project concludes that the filter may help limit losses around regime changes. Its evidence is preliminary: the short sample limits confidence, and the article recommends testing on more data and exploring other observations and strategies.

Key ideas

  • The model infers high- and low-volatility states from observed daily returns.
  • A Gaussian HMM regime estimate is used to gate moving-average crossover entries and exits.
  • The project compares the filtered and unfiltered strategy using held-out test data.
  • Reported effects vary by security, with some losses reduced and some gains diminished.
  • The 120-day sample is too limited to establish robust performance.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.