Categories

Spotting a Gartley, Bat, or Butterfly pattern by eye means manually measuring Fibonacci ratios between four or five swing points every time price makes a new high or low. The Harmonic Pattern Finder indicator automates that measurement, scanning your MetaTrader 5 chart’s swing structure for fourteen recognized harmonic patterns and drawing the completed legs the moment the ratios line up. It is free to download and runs directly in the MT5 terminal.
What Is the Harmonic Pattern Finder Indicator?
Harmonic Pattern Finder is an MT5 chart-window indicator built on a ZigZag swing structure. It calls an external ZigZag indicator (a companion file the indicator references by name) to identify the chart’s peaks and troughs, then walks backward through those swing points looking for sequences whose leg-to-leg ratios match the Fibonacci relationships that define named harmonic patterns: AB=CD, Gartley, Bat, Alt. Bat, Butterfly, Crab, Deep Crab, Three Drives, Cypher, Shark, 5-0, Nen Star, Black Swan, and White Swan.
Each pattern definition in the code specifies allowed ranges for ratios such as AB relative to XA, BC relative to AB, CD relative to BC, AD relative to XA, and CD relative to XC, with a configurable slack tolerance for how loosely those ratios can be matched. When a qualifying X-A-B-C-D (or A-B-C-D for the simpler AB=CD pattern) sequence is found, the indicator draws connecting trend lines between the points, plus dotted measurement lines and tooltips showing the calculated ratio percentages, in a bullish color for bullish patterns and a bearish color for bearish patterns.
An optional “emerging patterns” mode goes a step further: instead of only marking patterns that have already completed their D point, it can project where an incomplete pattern’s D point would need to land to complete a valid ratio, drawing that projection in a separate projection color and updating it as price continues to develop.
Key Features
- Fourteen harmonic patterns – AB=CD, Gartley, Bat, Alt. Bat, Butterfly, Crab, Deep Crab, Three Drives, Cypher, Shark, 5-0, Nen Star, Black Swan, and White Swan, each individually toggled on or off.
- ZigZag-based swing detection – pattern points are anchored to actual confirmed swing highs and lows rather than raw candle wicks.
- Configurable Fibonacci tolerance – SlackRange and SlackUnary control how much leeway is allowed when matching a leg’s ratio to a pattern’s defined Fibonacci target.
- Optional emerging-pattern projections – toggle EmergingPatterns to see forward-projected D points for patterns that haven’t completed yet, using ATR-based increments.
- Overlap control – MaxSamePoints limits how many swing points a newly found pattern can share with a previously drawn one, reducing duplicate/overlapping labels.
- Full color customization – separate colors for bullish patterns, bearish patterns, bullish projections, and bearish projections.
How to Use It
Copy the .mq5 file into the MQL5/Indicators folder of your MT5 data directory (File > Open Data Folder), refresh the Navigator, and drag it onto a chart. This indicator depends on a separate companion ZigZag indicator that it loads internally by name – if that companion file is missing from your Indicators folder, the terminal’s Experts log will show an error obtaining the indicator handle and no patterns will be drawn, so confirm the companion ZigZag file is installed alongside it.
Once running, watch for trend lines connecting labeled swing points (X, A, B, C, D) in the bullish or bearish color you configured. A completed bullish pattern generally signals traders to look for a reversal higher once the D point is reached and confirmed, with the X-A leg and prior swing structure used as a reference for stop placement; a bearish pattern is the mirror case. Hover over the drawn lines to see tooltips with the calculated ratio percentages (for example XAB%, XAD%, ABC%, BCD%) so you can judge how cleanly the pattern matched its textbook ratios versus how much slack was used.
If you enable EmergingPatterns, treat the projected D-point lines as “if this pattern completes, it would complete here” markers rather than confirmed signals – by design they are recalculated and can move or disappear as new bars form and the swing structure changes, since they are extrapolating from an incomplete leg using ATR increments rather than a confirmed price point.
Best Timeframes / Best Use Cases
Because the SwingSize input is defined in points and the History/BarsAnalyzed inputs cap how many bars are searched, this indicator works on any timeframe, but harmonic patterns are traditionally read on H1 and higher (H4, Daily) where swing points represent meaningful structural turns rather than intrabar noise. It fits swing-trading and reversal-based strategies built around confirmed geometric price structure.
Final Thoughts
Harmonic Pattern Finder turns a labor-intensive manual process – measuring Fibonacci ratios across multiple swing legs for fourteen different pattern templates – into something the chart does for you automatically. The optional emerging-pattern projections are a useful heads-up feature but are explicitly provisional by design, so lean on the confirmed pattern drawings, your own structure analysis, and proper risk management rather than trading a projection before its D point is actually confirmed by price.
- SwingSize (default 100) — Sensitivity (in points) of the underlying ZigZag used to define swing highs and lows.
- SlackRange (default 0.01) — Maximum tolerance allowed for pattern ratios defined as a min/max range.
- SlackUnary (default 0.1) — Maximum tolerance allowed for pattern ratios defined as a single fixed target.
- BarsAnalyzed (default 200) — Maximum number of bars searched per pattern when locating swing points.
- History (default 1000) — Maximum number of historical bars processed by the indicator.
- EmergingPatterns (default false) — Enables forward projection of incomplete patterns' D point using ATR-based increments.
- AtrPeriod (default 50) — ATR period used when calculating emerging-pattern projections.
FAQs About the MT4 Harmonic Pattern Finder Indicator MT5
Does the Harmonic Pattern Finder indicator repaint?
Confirmed patterns are drawn once a ZigZag swing point registers, but the ZigZag’s most recent leg can still shift as price develops, and the optional EmergingPatterns projections are explicitly designed to move or disappear as new bars form, so treat unfinished/projected patterns as provisional rather than fixed.
Which harmonic patterns does it detect?
AB=CD, Gartley, Bat, Alt. Bat, Butterfly, Crab, Deep Crab, Three Drives, Cypher, Shark, 5-0, Nen Star, Black Swan, and White Swan, each with its own on/off toggle input.
Do I need another indicator installed for this to work?
Yes. It loads a companion ZigZag indicator internally via iCustom; if that file is not present in your MQL5/Indicators folder, the handle creation fails and no patterns will be plotted.
What does the SlackRange / SlackUnary setting do?
They control how much tolerance is allowed when matching a measured leg ratio to a pattern’s defined Fibonacci target – SlackRange applies to ratios defined as a min/max range, SlackUnary applies to ratios defined as a single fixed value.
What is 'emerging patterns' mode?
When EmergingPatterns is enabled, the indicator projects where an incomplete pattern’s D point would need to land to complete a valid ratio, using ATR-based increments, and draws that projection in a separate color that updates as price develops.
Can I limit which patterns are displayed?
Yes. Each of the fourteen patterns has its own boolean Show_ input (Show_gartley, Show_bat, Show_butterfly, and so on) so you can disable the ones you don’t trade.
Harmonic Pattern Finder Indicator MT5
Spotting a Gartley, Bat, or Butterfly pattern by eye means manually measuring Fibonacci ratios between four or five swing points every time price makes a new high or low. The Harmonic Pattern Finder indicator automates that measurement, scanning your MetaTrader 5 chart's swing structure for fourteen recognized harmonic patterns and drawing the completed legs the…
Download the Harmonic Pattern Finder Indicator MT5