Skip to content
All library documents

Filtering a Moving Average Trend Strategy with CatBoost

Article MQL5 articles

Summary

The article presents a workflow for using CatBoost to filter trades from a moving average crossover trend-following strategy. The model is trained to classify trade outcomes as wins or losses, using market features recorded for each trade. The proposed role of the classifier is modest: reject trades with a low estimated chance of winning, while relying on a simple backbone strategy that already has some evidence of profitability and enough trades to support analysis.

The author describes exporting features from MetaTrader 5, combining them with trade outcomes from a backtest report, training and validating the model in Python, then integrating it into an Expert Advisor. The example uses XAUUSD on the hourly timeframe and reports a long historical test period, but the supplied text omits much of the model evaluation and results. It cautions that tree models need stationary features, advocates out-of-sample validation, and notes the risks of parameter tuning, excess filters, and overfitting. The method is an experimental workflow, not evidence that the filter will generalize to other markets or periods.

Key ideas

  • CatBoost is used to estimate binary trade outcomes and filter entries from a moving average crossover strategy.
  • A machine learning filter should build on a simple backbone strategy with an existing edge and adequate trade samples.
  • The workflow joins per-trade features with outcomes exported from a MetaTrader backtest.
  • Stationary inputs, out-of-sample validation, and restrained tuning are emphasized to reduce overfitting risk.
  • The article’s reported example does not establish that the approach will generalize to other markets or periods.

Tags

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