Skip to content
All library documents

Tracking Model-Level Orders in Multi-Strategy Expert Advisors

Article MQL5 articles

Summary

This article presents an architecture for running multiple trading models across instruments and timeframes within one MetaTrader 5 expert advisor. It frames the configuration problem as a set of model, timeframe, and instrument combinations, each of which needs its own parameters and money-management rules. A model is treated as an abstract strategy whose concrete instances receive their own settings.

The central design choice is to track each model instance’s orders independently instead of relying on the instrument’s aggregated net position. Opposing trades from different models can cancel in the net position even while each model still has exposure and future exit obligations. A per-instance order table links server-side order tickets to the model that created them. The article also describes a shared interface for managing models and an engine for capital limits, margin checks, and splitting requests into separate deals. It cites competition use as practical evidence, but provides no comparative performance analysis; the architecture is presented as complex to implement.

Key ideas

  • A multi-strategy system can be organized as model instances indexed by strategy, timeframe, and instrument.
  • An instrument’s net position does not reveal each strategy’s remaining exposure when their trades offset.
  • Each model instance can maintain its own order table linked to the order tickets stored by the server.
  • A common model interface lets one expert advisor coordinate distinct strategies and their money-management rules.
  • The described engine includes position and deal-size limits, margin checks, and handling for requotes and slippage.

Tags

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