Skip to content
All library documents

MQL5 Chart Limits and Class Inheritance for Manual Trading EAs

Article MQL5 articles

Summary

This article describes extending a manual MetaTrader EA so it can show chart lines for potential order limits while a trader positions an order with the mouse. It introduces a C_Terminal class to centralize shared terminal-related behavior and reduce duplicate code across the order and mouse classes, aiming to keep manual interaction separable from future automated trading logic.

The discussion also explains protected access and public, private, and protected inheritance through a conceptual analogy and a table of access outcomes. The article then outlines updating mouse and chart event handling so limit lines appear while modifier keys are held and are removed when they are no longer needed. This is implementation guidance for MQL5 EA development, not an evaluation of a trading strategy: it provides no market tests or evidence that the interface improves trading performance. Its focus is code organization and manual order visualization.

Key ideas

  • A manual EA can draw chart lines to preview potential order limits before an order reaches the trading server.
  • A shared terminal class can reduce duplicated behavior across order and mouse classes.
  • Protected members are available to derived classes but are not directly exposed to outside callers.
  • Mouse and chart events can coordinate showing and removing limit lines as modifier keys are pressed or released.

Tags

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