Skip to content
All library documents

A Flexible MQL5 Framework for Detecting and Displaying Candle Patterns

Article MQL5 articles

Summary

The article develops a reusable MQL5 framework for finding and displaying price patterns in timeseries data. It proposes an abstract base pattern class with specialized pattern classes, plus management objects that let a timeseries search for multiple patterns of the same type using different parameter sets. Found patterns are associated with their base bars and kept in a shared collection, making it possible to compare detections across symbols and periods.

The implementation adds candle proportions—body and upper and lower shadows relative to total candle size—as searchable properties, alongside pattern categories, direction, and type. A pin bar serves as the concrete example, with search criteria configurable rather than fixed. Detected patterns can be marked on a chart; hovering over a mark reveals a panel with its description and criteria. The article demonstrates software architecture and chart presentation, not the predictive value of the patterns or a tested trading strategy. The framework is presented as an extensible starting point, with further development planned.

Key ideas

  • A shared abstract pattern class can support specialized candle and price-action pattern types.
  • Search criteria can be varied across multiple instances of the same pattern type.
  • Candle body and wick proportions provide flexible features for pattern searches.
  • Pattern detections can be linked to timeseries bars and displayed with interactive chart annotations.
  • The example demonstrates detection infrastructure, not profitability or predictive accuracy.

Tags

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