Skip to content
All library documents

File-Driven Dynamic Configuration for Multi-Strategy MetaTrader EAs

Article MQL5 articles

Summary

This article presents a MetaTrader template that runs separate virtual experts for different symbol and timeframe combinations, with each configuration stored in text files. A supervising EA reads those files, creates or removes virtual charts and experts as configurations change, and can optionally synchronize settings through a web API or shared terminal folder. The file approach is intended to work across MetaTrader 4 and 5 and to allow external programs to edit strategy settings.

The design uses separate timers for fetching settings and loading them into memory, and restarts its configuration when it detects file changes. It also preserves the settings associated with open positions so that those positions can close under the same logic that opened them. The template describes one position per virtual chart, bar-by-bar signal processing, optional automatic lot sizing, and safeguards such as volume normalization. The article presents an extensible architecture rather than performance evidence: it acknowledges that the code needs further optimization, and its projected cross-currency optimization benefits are future aims, not demonstrated results.

Key ideas

  • A single MetaTrader EA can manage multiple symbol and timeframe strategies through virtual charts configured with text files.
  • Separate timers can handle remote setting updates and local configuration loading.
  • The template can detect added, changed, or removed settings and reconfigure its virtual experts automatically.
  • Stored opening settings allow open positions to retain their original trading logic until they close.
  • The article describes an adaptable framework, not evidence of trading profitability or tested risk reduction.

Tags

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