Recording Graphical Object Rename History in an MQL5 Library
Summary
This article extends a graphical-object library so programs can identify property-change events and retain an object's earlier names. It proposes storing the current name alongside prior names in a dynamic property array, allowing the library to display rename history and potentially restore earlier object states. The implementation adds message identifiers, property access, and journal output for renamed objects, while preparing the data structure for future history of other properties.
A chart-based test demonstrates that rename history is recorded and that bulk deletion is handled. The article also reports a limitation: some objects removed with a chart are not restored correctly in the collection when that chart is reopened, and the cause has not yet been identified. This is MQL5 event and state-management programming for chart tools, rather than a trading strategy or quantitative market analysis.
Key ideas
- The library records earlier names when a graphical object is renamed, preserving its rename sequence in object properties.
- A dynamic property array stores the current name and previous names so history can be displayed or potentially used to restore a prior state.
- The changes add event messages and journal reporting for object renames.
- A chart test demonstrates rename tracking and handling of bulk object removal.
- Some objects removed with a chart may not be restored correctly when the chart returns, and the issue remains unresolved.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.