Skip to content
All library documents

Scheduling Weekly MetaTrader 5 EA Optimization Across Two Instances

Article MQL5 articles

Summary

This document describes a setup for optimizing selected Expert Advisor parameters on a recurring schedule. One MetaTrader 5 instance runs the live EA and an optimizer EA; a second instance runs the Strategy Tester. The optimizer prepares configuration and parameter files, launches the tester, reads its report, and stores chosen values in global variables for the live EA to use. The example schedules optimization weekly and focuses on stop loss, take profit, and two stochastic-filter settings.

The workflow relies on copying files between terminal sandboxes with a Windows shell call, starting the tester with configuration options, and parsing its optimization report. The article gives example tester settings, parameter ranges, report output, and selected results, along with notes about using local, remote, or cloud agents. It is a platform automation example rather than evidence that frequent parameter re-optimization improves trading. The author notes that implementing it requires familiarity with MetaTrader 5 optimization and programming; the approach also depends on Windows DLL access and careful coordination of files and terminal instances.

Key ideas

  • A separate tester instance can perform scheduled optimization while another instance runs the trading EA.
  • The optimizer prepares tester configuration and parameter files, launches the tester, and reads its report.
  • Selected parameter values can be passed back to the running EA through terminal global variables.
  • The example optimizes stop loss, take profit, and two stochastic filter settings on a weekly schedule.
  • The workflow depends on Windows shell access, file copying, and familiarity with MetaTrader 5 tester configuration.

Tags

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