Automating 5-0 Harmonic Pattern Detection and Trading
Summary
This article explains how to build an MQL5 Expert Advisor to identify and trade the 5-0 harmonic pattern. It describes the six turning points and the bullish and bearish structures, then uses swing highs and lows to assemble candidate legs. Fibonacci extensions and retracements validate the pattern: the B point extends the XA leg, C spans a specified portion of AB, and D retraces part of BC into a potential entry zone. The EA is also designed to draw pattern markers on the chart.
The implementation outline covers copying candle data, locating pivots, checking ratios, and connecting pattern detection to order execution. The described example places a buy after bullish confirmation and sets a target based on the distance from price to D. The article focuses primarily on bullish detection, with bearish logic described as a directional adaptation. It does not provide backtest results or evidence that the pattern generates profitable trades; pivot selection, ratio tolerances, and execution choices remain implementation-dependent.
Key ideas
- The 5-0 pattern is defined by six pivots forming four price legs.
- Fibonacci extension and retracement ranges are used to validate candidate structures.
- Swing detection and candle history provide the basis for assembling pattern points programmatically.
- The proposed EA draws validated patterns and can connect bullish confirmation to trade execution.
- The article gives implementation guidance but no evidence of profitability or backtest performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.