Managing Composite Chart Objects with Pivot-Point Forms
Summary
This installment develops support for composite graphical objects in the DoEasy MQL5 library. It introduces a toolkit that associates pixel-based form controls with an extended chart object's pivot points, allowing the forms to follow those points when the chart is moved or its scale changes. The forms are intended to support hovering, dragging and, in later work, attaching subordinate objects to a base object.
The article describes library message and macro updates, creation and removal of control forms, and event handling for chart changes. A test application shows forms staying at their designated points through chart changes and being removed along with their graphical object. The author reports a lag during chart updates and considers it acceptable because the movement is mainly hidden during interaction; the article does not yet implement object attachment or provide trading-performance evidence.
Key ideas
- Pixel-based control forms can be anchored to the pivot points of extended chart objects.
- Chart-change events are used to recalculate form positions when a chart moves or its display scale changes.
- Forms are designed to reveal anchor points on hover and let users modify objects by dragging.
- The demonstrated implementation handles form creation, movement and cleanup, while attachment between objects remains future work.
- The test shows the forms following chart changes, with some lag during updates.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.