Skip to content
All library documents

Parallelizing MetaTrader 5 Calculations Across Expert Advisors and Indicators

Article MQL5 articles

Summary

The article investigates how MetaTrader 5 distributes indicator and expert-advisor work across processor cores. Using CPU-heavy test programs on charts with different symbol arrangements, it reports that two indicators on the same symbol used one core, while separate symbols could use two; two expert advisors on different charts used two cores in the tested configurations. It then proposes splitting a workload between computational modules and a main module that handles coordination and trading or display duties.

Because these components are separate terminal programs, they do not call each other directly. The described design uses shared terminal global variables as an exchange buffer, with events triggering each component’s work. A pattern-searching expert advisor example is used to compare regular and parallel operation; the logs show similar behavior and successful data exchange. The results are observations from the author’s test setup rather than a broad benchmark, and they depend on how charts, symbols, and programs are arranged. The article explains an implementation approach, not a general guarantee of proportional speedup.

Key ideas

  • MetaTrader 5 can run some indicator and expert-advisor workloads on separate processor cores.
  • The observed core use depends on symbol and chart arrangement in the test setup.
  • A parallel design separates computation into modules and delegates coordination to a main module.
  • The independent modules exchange data through shared terminal global variables.
  • The reported pattern-search example demonstrates feasibility but does not establish universal speedup.

Tags

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