Skip to content
All library documents

Machine Learning Mean Reversion with Filter Labels and Regime Clustering

Article MQL5 articles

Summary

The article develops a machine learning mean reversion system for EURGBP, covering trade labeling, market regime identification, model training, and deployment in MetaTrader 5. It contrasts random horizon labels with labels based on how far prices deviate from a Savitzky–Golay smoothed series. Quantile thresholds mark upper deviations as sell examples and lower deviations as buy examples; observations between the thresholds are discarded. The article cautions that this non-causal filter can redraw recent values, so it is suitable for labeling historical data rather than generating live signals.

The workflow also clusters market observations into regimes, trains classifiers for direction and regime suitability, and exports models for a trading bot. The author presents EURGBP as a range-bound test case and describes testing the resulting strategy, but the supplied excerpt does not provide performance statistics or enough detail to assess robustness. Results depend on labeling and model choices, and the article’s own warning about historical filtering makes careful separation of training and live data essential.

Key ideas

  • Random horizon labeling may create targets without a meaningful market pattern for the model to learn.
  • Price deviations from a Savitzky–Golay smooth can define buy and sell labels using quantile thresholds.
  • The filter can revise recent values, so the article recommends it for historical labeling rather than live signals.
  • Clustering is used to identify market regimes and gate a directional classifier.
  • The proposed workflow trains models in Python and deploys them in a MetaTrader 5 trading system.

Tags

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