Skip to content
All library documents

Exporting Expert Advisor Trade Histories from the Strategy Tester

Article MQL5 code base

Summary

This document explains how an MQL5 Expert Advisor can export its trade history after a Strategy Tester run. It describes creating a history-export object, calling its export method from the tester callback, and optionally attaching the expert’s name, version, and parameter values to the exported record. A single-run condition can prevent exports during optimization runs.

The export settings control the output filename, format, and whether the file is saved in the shared terminal folder or the local terminal folder. The default format can include account details, the test period, and drawdown information. The resulting file can support replaying the same trade sequence on another server through a separate receiver expert. This is an implementation utility rather than a trading strategy, and the document provides no performance evidence or safeguards for validating whether a replay matches the original execution environment.

Key ideas

  • An Expert Advisor can export tester trade history by calling the export method from the tester completion callback.
  • The export object can include the expert name, version, and selected input parameters as metadata.
  • A condition on optimization mode can restrict saving to individual tester runs.
  • Export options determine the filename, output format, and shared or local destination.
  • The exported history is intended to help reproduce a trade sequence on another server.

Tags

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