Skip to content
All library documents

Exporting Strategy Tester Trade Histories from an Expert Advisor

Article MQL5 code base

Summary

This document describes a MetaTrader expert-history utility for exporting trades generated during an Expert Advisor run in the Strategy Tester. It shows how to create the exporter object and call its export method from the tester’s completion handler. The resulting file can be written to a shared terminal directory or a local terminal directory, and is intended to support replaying the trade sequence on another trading server with a compatible receiver.

The extended setup allows the user to provide an expert name and version, choose separators, attach input parameters such as symbol and stop-loss or take-profit settings, and control whether export occurs during optimization. Export options include a manual or generated filename, history format, filename format, and destination. The default format may include account and test metadata in addition to transactions. This is a workflow description rather than a trading strategy; it does not explain how to validate replay fidelity, reconcile server differences, or assess strategy performance.

Key ideas

  • Call the export method when a Strategy Tester run completes to save its deal history.
  • The export can be directed to shared or local terminal storage.
  • Custom metadata can record the expert identity and selected input parameters.
  • Filename and export format options determine which details accompany the trade records.
  • A compatible receiver is needed to replay the recorded 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.