Building an MQL5 Scanner for Unmitigated Fair Value Gaps
Summary
The article presents an object-oriented MQL5 scanner for detecting and displaying Fair Value Gaps (FVGs). It defines bullish and bearish gaps through a three-candle comparison, loads historical OHLC data with CopyRates, and checks that enough data is available before scanning. A mitigation pass examines later candles and excludes a zone once price has touched it. The scanner also uses configurable symbol, timeframe, history depth, and object naming so it can manage chart drawings without disturbing unrelated objects; scanning is triggered on new bars to reduce repeated work.
The result is a zone-detection and visualization component, not a trading or execution system. The article recommends higher-timeframe alignment and volume checks as possible extensions, but the supplied implementation does not demonstrate that these filters improve outcomes. Its claims about institutional order flow and price returning to gaps are not supported by empirical tests in the text, so detected zones should be treated as candidate areas for analysis rather than validated signals.
Key ideas
- The scanner identifies bullish and bearish gaps using price relationships across three candles.
- CopyRates data availability is checked before historical scanning proceeds.
- A mitigation check removes zones that later price action has touched.
- Object-oriented state and unique chart-object prefixes support multiple scanners and safer drawing management.
- The scanner identifies areas of interest but does not place trades or validate profitability.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.