Skip to content
All library documents

A Modular MQL Design for Signals, Trade Processing, and Position Support

Article MQL5 articles

Summary

The article presents a modular way to organize an automated trading system in MQL, a language the author says lacks a built-in object-oriented model for this purpose. It separates the system into signal modules that interpret quotes and indicators, entry and exit processors that act on signals, and position-support routines that manage open trades. Signal identifiers, including the MAGIC identifier, are used to associate orders and settings with particular systems when several operate on one account.

The examples show indicator-based signal functions, parameter arrays for targets, stops, trailing behavior, and position additions, plus calls that connect signal processors to position-management routines. The approach is a proposed programming structure rather than a tested trading strategy. The article does not provide comparative performance evidence, and its examples do not demonstrate that the modular design improves trading results. It also acknowledges that system behavior depends on the selected signals, order-handling rules, and support logic.

Key ideas

  • The proposed design separates signal generation, entry and exit handling, and position support into distinct modules.
  • Signal identifiers help route signals and distinguish a system’s orders and parameters.
  • The examples use indicator conditions to produce entry and exit instructions.
  • Arrays can hold per-system settings such as stops, targets, trailing distances, and position-addition rules.
  • The article describes software organization and does not establish that the design improves strategy performance.

Tags

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