Skip to content
All library documents

Automating Supply and Demand Zone Lifecycles in MQL5

Article MQL5 articles

Summary

The article describes an MQL5 framework that turns chart rectangles into managed supply and demand zones. A CZone class stores each zone’s price boundaries, type, source, age, breakout tracking, and visual state, while a dynamic object collection tracks zones as they are created, updated, merged, or removed. The system is designed to synchronize manual chart edits with automated analysis and rendering.

Zones can be classified using live prices, merged according to volatility-scaled proximity, and moved through virgin, broken, and inactive states. Breakouts require configured confirmation, and broken zones can remain visible as ghosts for a limited period, with optional reactivation if price returns inside the range. The article presents an implementation architecture and configurable parameters, but the supplied excerpt is incomplete and offers no empirical trading results. It explains chart and state management rather than demonstrating that the resulting zones predict profitable trades.

Key ideas

  • A wrapper class can give chart rectangles persistent pricing, lifecycle, and visual state.
  • Dynamic object containers support collections that change as zones are added, merged, or removed.
  • The framework classifies zones and tracks breakout confirmation through configurable state transitions.
  • Broken zones may remain as ghosts temporarily and can optionally reactivate when price returns inside their range.
  • The article describes software architecture, without evidence that its zones improve trading performance.

Tags

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