Skip to content
All library documents

Extending an MQL5 Mouse Tool for Chart-Based Analysis

Article MQL5 articles

Summary

This article extends an MQL5 mouse-interaction class for chart analysis without relying on inheritance for the new functionality. It describes recording mouse position as both screen coordinates and chart time and price, converting between those coordinate systems, and adjusting time values to chart bars. It also explains a chart-object setting that lets users click overlapping objects while preserving mouse-move events used by the analysis tool.

The later examples apply the expanded interaction model to drawing interface elements and sizing text, including discussion of font-size units. The stated aim is to add a separate analysis feature while keeping the tested base class intact. The article offers implementation guidance and recommends trying the application in replay or simulation and on a demo or live account, but it reports no trading strategy or measured performance results. Its main value is software design and chart usability rather than evidence about market behavior.

Key ideas

  • Chart interaction can track mouse position in both screen coordinates and time-price coordinates.
  • Conversion functions allow analysis tools to work with chart coordinates rather than pixels alone.
  • A chart-object setting can preserve click access to overlapping objects while retaining mouse-move events.
  • A separate class can add analysis features while leaving the established base class unchanged.
  • The article discusses interface implementation and testing contexts, not trading performance.

Tags

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