Skip to content
All library documents

Multi-Currency EA Architecture with Aggregated Virtual Positions

Article MQL5 articles

Summary

The article revises the design of a multi-currency Expert Advisor that runs multiple strategies. Its initial architecture lets each strategy place market orders directly, which can leave some strategies unable to trade when position sizes fall below broker minimums and can create offsetting positions that still incur swaps. The revised design has strategies manage virtual positions while a receiver aggregates their requested exposure and adjusts real market positions when virtual holdings change.

The proposed refactor separates core strategy and advisor base classes from virtual-trading extensions, centralizes virtual position storage in a singleton receiver, and assigns symbol-specific receivers to manage positions by instrument. The article reports that the updated implementation ran at similar speed and no worse than its predecessor. It also gives historical tests: an optimized 2022 configuration had roughly 150% profit with about 50% expected drawdown, while 2023 out-of-sample results were weaker, with 40% profit but uneven monthly growth. These figures are specific to the reported setup and do not establish robustness; the article identifies generalization and parameter selection as continuing problems.

Key ideas

  • Direct order placement by multiple strategies can create minimum-volume constraints and opposing positions that accrue swaps.
  • Virtual positions let strategies express exposure while a receiver consolidates and routes aggregate market volume.
  • A shared virtual-position store and symbol-specific receivers are proposed to simplify multi-currency coordination.
  • The architecture moves virtual-trading features out of generic strategy and advisor base classes.
  • Reported 2022 and 2023 tests show weaker out-of-sample consistency, underscoring the limits of optimized results.

Tags

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