Skip to content
All library documents

Filtering MQL5 Optimization Passes and Exporting Their Results

Article MQL5 articles

Summary

This article explains how to capture results from each MQL5 Expert Advisor optimization pass and save selected results with the input parameters that produced them. It uses the Strategy Tester’s optimization events and frames to transfer pass statistics, then writes qualifying results to a file. Users can enable or disable reporting, select up to three statistics, set thresholds, and choose whether all selected conditions or any one condition must be met. Most statistics are tested against minimum thresholds, while equity drawdown is selected using a maximum threshold.

The example selects passes with profit factor above 1 and recovery factor above 2, reporting that 719 of 101,000 passes met those criteria in the described run. These figures demonstrate the filtering workflow, not trading profitability or the quality of the selected settings. The article focuses on MQL5 implementation and file output; it does not provide out-of-sample validation, account for selection bias, or establish that the chosen criteria generalize to live trading.

Key ideas

  • MQL5 optimization events can capture and process results as parameter passes finish.
  • Frames carry statistics from a pass and can be paired with the inputs that generated it.
  • Users can filter results with up to three statistical criteria and combine them using AND or OR logic.
  • The example exports qualifying statistics and parameters to a file for later inspection.
  • Optimization filtering organizes results but does not establish that selected settings will perform well out of sample.

Tags

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