Discussing the article: "How to Detect and Normalize Chart Objects in MQL5 (Part 1): Building a Chart Object Detection Engine"

 

Check out the new article: How to Detect and Normalize Chart Objects in MQL5 (Part 1): Building a Chart Object Detection Engine.

This article addresses the interpretative gap between visual chart objects and algorithmic execution. You will build a systematic detector that iterates over all chart objects, identifies analytical types, and normalises their geometric data (time and price coordinates) into a structured SChartObjectInfo array. The implementation uses raw MQL5 functions, a filter‑extract‑store pipeline, and a timer‑driven test EA, resulting in a reusable framework for rule‑based trading inputs.

This article presents a systematic MQL5 approach for detecting chart objects, identifying them, and extracting their properties automatically. We will build a reusable detection engine. It iterates over all chart objects, keeps only analytical types (trendlines, rectangles, channels, horizontal/vertical lines, Fibonacci tools, etc.), and returns normalized time/price coordinates. The goal is to turn subjective visual analysis into consistent, rule‑based inputs for algorithmic trading systems.

Conceptual Flow

From trader‑drawn objects, the detection algorithm harvests time, price, and identification data, producing a structured stream (SChartObjectInfo array) that enables subsequent algorithms for manipulation, event reaction, and automated trading decisions.

By the end of this article, you will have two ready‑to‑use files: ChartObjectDetector.mqh (a class encapsulating the detection logic) and ObjectDetectionTestEA.mq5 (a test Expert Advisor that logs all detected objects every few seconds). You can include the detector in any EA to access all drawn analytical objects as structured data, enabling automated strategies that react to trendlines, support/resistance levels, and Fibonacci zones.

Author: Clemence Benjamin