Exporting Trading History and Metrics for Continuous Walk-Forward Optimization
Summary
This article explains how to adapt an MQL5 Expert Advisor to an auto optimizer by exporting its trading history and parameters. A report writer appends deal data and summary statistics to a file in the terminal’s shared files area, including profit, trade counts, winning and drawdown streaks, recovery factor, profit factor, payoff, and drawdown. The example adds commission and slippage inputs and saves the report when the EA finishes a Strategy Tester run.
A second utility groups detailed deal history by position and writes fields such as timestamps, volume, price, commission, and profit. Together, the functions connect history retrieval and report generation to the optimizer’s data pipeline. The article describes implementation plumbing rather than a trading strategy or evidence that optimization improves performance. It also provides only part of the detailed report implementation, refers to earlier series installments for supporting classes, and notes that a DLL is required for the XML reporting components.
Key ideas
- The report writer appends rows and writes column headers when it creates a new shared file.
- An EA can export deal history and selected input parameters after a Strategy Tester run.
- The summary report records performance and streak statistics for later analysis.
- A separate function exports detailed deal records grouped into positions.
- The utilities connect history downloading with report generation for an auto optimizer.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.