Discussing the article: "Automating Trading Strategies in MQL5 (Part 32): Creating a Price Action 5 Drives Harmonic Pattern System"

 

Check out the new article: Automating Trading Strategies in MQL5 (Part 32): Creating a Price Action 5 Drives Harmonic Pattern System.

In this article, we develop a 5 Drives pattern system in MQL5 that identifies bullish and bearish 5 Drives harmonic patterns using pivot points and Fibonacci ratios, executing trades with customizable entry, stop loss, and take-profit levels based on user-selected options. We enhance trader insight with visual feedback through chart objects like triangles, trendlines, and labels to clearly display the A-B-C-D-E-F pattern structure.

The 5 Drives (5-0) pattern is a harmonic trading formation defined by six key swing points—A, B, C, D, E, and F—existing in bullish and bearish forms, designed to identify reversal zones through a sequence of drives and retracements with specific Fibonacci retracement ratios. In a bullish 5 Drives pattern, the structure forms a high-low-high-low-high-low sequence where A is a swing high, B a swing low, C a swing high, D a swing low, E a swing high, and F a swing low (above B), with the AB and CD legs extending 1.13 to 1.618 of the prior leg, BC and DE extending 1.618 to 2.24, and CD equaling AB with a 0.5 retracement; a bearish pattern reverses this sequence with F below B. Here is a visualization of the patterns:

Bearish Harmonic 5 Drives pattern:

BEARISH 5 DRIVES PATTERN

Bullish Harmonic 5 Drives pattern:

BULLISH 5 DRIVES PATTERN

Our approach involves detecting these swing pivots within a specified bar range, validating the pattern’s legs against Fibonacci criteria, visualizing the A-B-C-D-E-F structure with chart objects like triangles and trendlines, and executing trades at the F point with customizable stop loss (Fibonacci-based or fixed) and take-profit levels (one-third, two-thirds, or E pivot) to capitalize on anticipated reversals. Let’s proceed to the implementation!

Author: Allan Munene Mutiiria