Skip to content
All library documents

Collecting Expert Advisor Optimization Results for Statistical Analysis

Article MQL5 articles

Summary

This article describes a MetaTrader 4 workflow for collecting profitable Expert Advisor optimization runs across multiple backtests into HTML tables that can be analyzed in spreadsheet software. It proposes recording separate results for long and short strategies, including timeframe, performance measures, and the EA’s external parameter names and values. The resulting combined dataset makes it possible to compare parameter sets across optimization periods rather than selecting each period’s single best run in isolation.

The article gives implementation guidance for exporting the results from an EA’s deinitialization routine and discusses the table’s contents and limitations. Its drawdown measures are based on closed trades, so they can differ from the strategy tester’s figures; profit factor is also not meaningful when there are no losing trades. The approach supports statistical investigation of parameter stability, but the article supplies no out-of-sample validation or evidence that this selection process predicts future performance. It is a data collection and analysis workflow, not a trading strategy in itself.

Key ideas

  • A combined record of optimization runs makes it possible to compare parameter choices across different test periods.
  • The proposed export separates long and short results and records each strategy’s timeframe and external parameters.
  • HTML tables can be opened in spreadsheet software for further statistical analysis.
  • The reported drawdown is calculated from closed trades and may differ from the strategy tester’s measure.
  • Profit factor is assigned zero when a run has no losing trades, although that value is not informative as a conventional profit factor.

Tags

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