Modeling Chart Objects for a Visual MQL5 Order System
Summary
This installment develops the chart interface for an MQL5 Expert Advisor order system. It builds on earlier work distinguishing netting accounts, where an asset has a consolidated position, from hedging accounts, which can hold multiple positions with separate limits. The aim is to display order and position information directly on the chart, including relevant profit and loss limits for OCO orders, so users can inspect and adjust values visually.
The implementation replaces a horizontal-line class with a broader object-management class. It generates unique chart object names from order identifiers and object types, allowing the platform to manage multiple independently interactive objects and their events. The article discusses alternative data models, encapsulation, and changes to order placement logic. This is an implementation installment rather than a complete order-management guide; the displayed changes are partial, and the trading rules themselves are not evaluated.
Key ideas
- Netting accounts consolidate an asset position, while hedging accounts can hold multiple positions with separate limits.
- The proposed interface displays order details and OCO profit or loss limits on the chart.
- Unique object names based on order identifiers and object types let chart elements be managed independently.
- The article focuses on system design and implementation changes rather than testing trading performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.