Virtual Order Management for Multiple EAs in MetaTrader 5
Summary
This article explains how a Virtual Order Manager (VOM) can preserve order-centric behavior in MetaTrader 5, where multiple trades on one symbol may be combined into a single position. It targets setups where several Expert Advisors, or a complex EA, need to track simultaneous opposing trades, grids, or pyramiding. The VOM maintains virtual market and pending orders, stops, and targets on the client terminal, while keeping a more distant server-side stop for protection if the terminal or connection fails.
A moving-average crossover EA illustrates the library’s use, and the article describes its internal components and Strategy Tester support. The example backtest is explicitly described as statistically inconclusive because it has few trades, so it is not recommended as evidence for live use. The approach also adds operational risk: virtual exits depend on the terminal, may slip more during volatile markets, and testing is reported to run more slowly. Its usefulness therefore depends on reliable connectivity and careful risk controls.
Key ideas
- MetaTrader 5 can merge trades on a symbol into a position, complicating order tracking for multiple EAs.
- A VOM tracks virtual orders, pending orders, stops, and targets independently of broker-side positions.
- Virtual exits allow order-centric strategies such as opposing trades, grids, and pyramiding.
- A distant server stop provides backup protection if the client terminal or connection fails.
- Virtual exits can face larger slippage and operational risk; the example backtest is statistically inconclusive.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.