A nautilus shell in cross-section with five glowing nodes traced along its logarithmic spiral, representing harmonic pattern geometry

Harmonic Patterns Explained: Gartley, Bat, Butterfly and Crab

Harmonic patterns have an image problem. The names sound like astrology — Bat, Crab, Butterfly, Cypher — and the charts, with their zigzag overlays and decimal annotations, look like a system invented to be complicated.

Strip away the presentation and there's something considerably more prosaic underneath. All eight patterns are the same five-point skeleton. What separates a Gartley from a Crab is nothing but the ratio table: which Fibonacci relationships each of the four legs is required to satisfy. That's it. Learn the table and harmonic trading becomes a measurement problem with an unambiguous answer.

We touched on harmonics on this blog in 2023. This is the proper treatment, and the framing is different: not "here are some patterns" but "here is why the ratios are the whole thing", which is what Harmonic Patterns automates.

The XABCD skeleton

Every harmonic pattern is five points connected by four legs:

  • X to A — the impulse leg. The initial move that establishes the range everything else is measured against.
  • A to B — the first retracement. Measured as a percentage of XA. This ratio is the primary discriminator between patterns.
  • B to C — a retracement of AB.
  • C to D — the final leg. Measured both as an extension of BC and as a retracement or extension of XA.

Point D is the whole purpose of the exercise. It's the Potential Reversal Zone — the price the geometry projects as where the pattern completes and a turn becomes plausible. Everything before D is measurement; D is where a decision gets made.

Note the direction of causation, because it's easy to get backwards. You don't find D by looking for it. You measure XA, AB and BC, and the ratios tell you where D must be for the pattern to be valid. The level is calculated, not observed.

The ratio table

The indicator detects eight patterns, and the meaningful differences between them are these:

Gartley. The original, from H.M. Gartley's 1935 work. B retraces 0.618 of XA; D completes at 0.786 of XA. D sits inside the XA range — a retracement pattern.

Bat. A shallower B retracement (0.382–0.50 of XA) and a deeper D at 0.886 of XA. Still inside the XA range, but D sits closer to X than the Gartley's. The shallow B is the identifying feature.

Alt Bat. A variant with an even shallower B (0.382) and D projected as a 1.13 extension of XA — so D sits just beyond X. The point where the family stops being purely retracement-based.

Butterfly. B retraces 0.786 of XA, and D extends to 1.27 of XA. D is outside the XA range — an extension pattern. Where the Gartley catches a pullback, the Butterfly catches an overshoot.

Crab. The most extreme extension: D projects to 1.618 of XA. The deepest overshoot in the family, with correspondingly the tightest reversal zone.

Deep Crab. A Crab with a deeper B retracement (0.886), same 1.618 completion.

Shark. Uses a 0.886–1.13 retracement of a different reference leg and completes at a 1.13–1.618 extension. Structurally distinct from the Gartley family.

Cypher. The odd one out. Its C point extends beyond A — which the others don't permit — and D retraces 0.786 of the XC leg rather than XA. Different measurement basis entirely.

The practical division worth carrying: retracement patterns (Gartley, Bat, Deep Crab) complete inside the XA range and catch pullbacks within an existing move. Extension patterns (Butterfly, Crab, Alt Bat) complete beyond X and catch exhaustion after an overshoot. Those are different market situations calling for different expectations, and lumping all harmonics together as "reversal patterns" loses that.

Why manual detection fails

Three reasons, in increasing order of severity.

Precision. The ratios are specific. 0.618 is not 0.65. A pattern where B retraced 0.70 of XA is not a Gartley, and treating it as one means the projected D has no basis. But 0.618 and 0.70 look nearly identical on a chart, and eyeballing is not measurement.

Attention. Eight patterns, both directions, across multiple instruments and timeframes. A person watching one chart will find some of them. Most valid patterns form somewhere you weren't looking.

Hindsight. This is the serious one. Harmonic patterns are trivially easy to find in historical data, because you can select the five points that make the ratios work. Doing it in real time, before D, with only X, A, B and C available, is a completely different task. Every trader who has ever concluded harmonics work brilliantly by scrolling back through a chart has proven only that the pattern definition is flexible enough to fit something.

Rule-based automated detection eliminates all three. The ratios are validated to their actual tolerances, every instrument is scanned continuously, and — critically — detection happens forward in time from the data available at the time.

Cancellation: the feature that keeps it honest

Patterns update dynamically as price develops, and get automatically cancelled when price invalidates the structure against the Fibonacci rules.

Users sometimes read a disappearing pattern as a bug. It's the opposite — it's the mechanism that prevents the tool from lying to you. A pattern that required D at 0.786 and has now seen price trade to 0.95 is not a valid pattern any more. Leaving it drawn would present an invalidated setup as live.

There's a related nuance worth stating precisely. Patterns can update at Point D as price evolves, because until D is reached the pattern is a projection rather than a completed structure. That's real-time market structure, not historical repainting: once a pattern completes and confirms, it doesn't change retroactively. The distinction matters if you're evaluating the tool — a projection that refines as new data arrives is behaving correctly.

The cancellation signal is exposed as a plot, which makes it directly usable for risk management: a strategy holding a position based on a harmonic completion can be told the moment the structure it relied on is void.

Configuring the tolerances

You can define retracement ranges per pattern or enforce exact ratios.

This is a real trade-off rather than a preference. Exact ratios produce very few, very high-quality detections — price rarely hits 0.618 to the tick. Ranges produce more patterns of more variable quality. Most traders end up with modest tolerances, wide enough that patterns actually form and tight enough that the ratio still means something.

The failure mode to avoid is widening tolerances until you get the pattern count you wanted. At sufficiently loose settings every zigzag becomes a harmonic, and the ratio table — the only thing giving the patterns any content — stops constraining anything.

The plots

  • Pattern detection signals, bullish and bearish, with update tracking
  • Pattern type as a numeric output — so a strategy can trade Crabs and ignore Gartleys, or vice versa
  • Cancellation signals
  • Swing switch detection, for confirming late reversals

The numeric pattern type is more useful than it appears. Retracement and extension patterns behave differently, and a strategy that filters on type can apply different logic to each rather than treating all eight as one signal. All of it works in Strategy Builder without NinjaScript, plus BloodHound and Blackbird.

Confluence at point D is not optional

The product documentation says harmonics are best used with support/resistance, market structure or other confluence tools, and that deserves emphasis rather than a footnote.

A completed harmonic gives you a precise price and a directional expectation. What it doesn't give you is any evidence that the market cares. The geometry is a projection derived from prior legs — it is not a statement about current order flow.

So the useful question at D is always: what else is here?

  • A bullish Order Block or an unmitigated FVG at the same price
  • A cluster of equal lows just beyond D — D reached via a liquidity sweep is a far better sequence than D reached on a drift
  • Multi-indicator divergence at the D pivot, confirming momentum exhaustion
  • Alignment with the higher-timeframe draw from ICT Bias
  • D landing at the POC or a Value Area edge from Volume Profile

A Crab completing at a level nothing else recognises is geometry. A Crab completing into a swept liquidity pool at an order block with divergence is a confluence trade that happens to have been located by geometry.

Common mistakes

Trading D because the pattern completed. Completion means the ratios were satisfied. It says nothing about whether anyone is defending that price.

Loosening tolerances until patterns appear. The ratios are the entire content of the method. Widen them enough and you're drawing zigzags.

Treating cancellation as a malfunction. A cancelled pattern is the tool refusing to show you an invalidated setup. That's the feature working.

Backtesting by eye. Scrolling through history and finding beautiful harmonics proves nothing, because you chose the points. Use the historical detections the indicator produced under its own rules.

Treating all eight patterns identically. A Gartley catches a pullback inside a range. A Crab catches an overshoot beyond it. Different situations, different context required, different expectations.

What automation actually changes

It removes discretion from the identification step. The ratios either validate or they don't; the scan runs across everything continuously; invalidated patterns disappear rather than lingering as wishful thinking.

What it doesn't do is make the pattern a reason to trade. Point D is a location. Whether it's worth acting on is a question about what else is at that price — which is what the rest of the toolkit is for.

Disclaimer: Trading futures and other leveraged instruments involves substantial risk of loss and is not suitable for all investors. Past performance and indicator signals are not indicative of future results.

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.

1 of 4
1 of 5