Discussing the article: "Building a Position Lifecycle Manager in MQL5 (Part 2): Managing Manual and Multi-Symbol Positions"
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Building a Position Lifecycle Manager in MQL5 (Part 2): Managing Manual and Multi-Symbol Positions.
This update adds manual position adoption and multi-symbol lifecycle management. The manager detects and tracks positions regardless of the chart, applies initial protection, transitions to break-even under fixed or ATR triggers, and validates broker constraints per symbol. Using the MACD sample for context, it demonstrates reusable management across instruments and manually opened trades.
In Part 1, we built the foundation of the Position Lifecycle Manager around a clear separation of responsibilities. The MACD sample EA generated trading signals and opened positions, while the Position Manager handled protection and subsequent lifecycle management. Part 2 extends this architecture by moving order submission into the Position Manager.
This included protection, break-even management, lifecycle state and continuous monitoring. This phase focuses on extending that foundation to manual and multi-symbol position management.
While the MACD example continues to provide the trading context, broader testing exposed an important limitation. The manager was still using the chart symbol as part of its position discovery and management context. That works for a conventional single-symbol EA but limits the reusability of the component.
A position manager should follow the position it manages rather than the chart where the manager happens to be attached.
This becomes particularly important in Manual Mode. The manager can remain attached to one chart while a trader opens positions on other instruments. Those positions should be detected, adopted and managed without requiring another manager instance on each chart.
The same principle applies to EA Mode. Once a position has been identified as belonging to the configured trading system, its own symbol should determine the market data, price calculations, broker constraints and execution settings used throughout its lifecycle.
The resulting architecture can be summarized in the following diagram.
Author: Francis Nyoike Thumbi