Concept
Gartley
Gartley, also known as 222 pattern, is a Elliott & Harmonics concept. The Library holds 1 implementation, a working definition you can pull into Quant.
Top Gartley indicator
The top custom implementation, built on the original standard Gartley formula.
1 total
The Gartley implementation below can become a backtested trading strategy — describe your rules and Quant writes the code.
What is a Gartley?
The Gartley is a five-point XABCD retracement pattern first sketched by H.M. Gartley in his 1935 book Profits in the Stock Market, on page 222, which is why it is also called the 222 pattern. Price makes an impulsive XA leg, pulls back to B, bounces to C, and completes at D inside the span of XA. The Fibonacci ratios that now define it were added by later authors: in the common modern reading, B retraces 0.618 of XA, C retraces 0.382 to 0.886 of AB, and D completes at the 0.786 retracement of XA, ideally where an internal AB=CD finishes as well.
Gartley himself was a Wall Street analyst and educator, and his original diagram was a trend-continuation pullback without Fibonacci arithmetic. The ratio-defined version emerged decades later as harmonic patterns became a distinct discipline: Larry Pesavento attached Fibonacci ratios to the structure, and Scott Carney's late-1990s work fixed the 0.618 B and 0.786 D most detectors now implement, drawn from the broader harmonic ratio set.
Traders treat the D completion as a potential reversal zone: a confluence of ratio projections where the pullback against XA is expected to end and the original direction to resume. It is a place to evaluate a reversal with defined risk, not a promise of one; price that trades decisively beyond X invalidates the pattern, and completions fail regularly when the move against XA is strong.
In Elliott terms, XA reads as part of a motive wave and the A-to-D structure as a corrective wave, the ratio checks mirroring familiar Fib wave relationships. Beyond any hit rate, the pattern forces a trader to define the impulse, the correction, the invalidation point, and the entry zone before the trade exists, which makes it a risk framework as much as a pattern.
How to identify a Gartley pattern on a chart
A Gartley is measured, not eyeballed: work from swing pivots, ideally the ones a ZigZag would mark, and check each leg against its ratio.
- 1Find a strong directional XA leg, an impulse off a meaningful swing point, and mark X at its origin and A at its extreme.
- 2Mark B where the first pullback ends and measure its retracement of XA; near 0.618 keeps the Gartley count alive, while much shallower or deeper readings point to other patterns.
- 3Mark C where the bounce from B stalls; it should retrace between 0.382 and 0.886 of AB and stay inside A.
- 4Project D in advance: the 0.786 retracement of XA and the AB=CD completion should land in overlapping territory; that overlap is the zone worth watching.
- 5Check invalidation before entry: D must complete inside the XA span, and a decisive close beyond X voids the pattern regardless of how good the ratios looked.
How it's calculated
The Gartley is a four-leg XABCD retracement pattern whose D point completes near the 0.786 retracement of the initial XA leg.
Named for H.M. Gartley, whose Profits in the Stock Market (1935) shows the pattern on page 222, hence the alias 222 pattern; the ratio table above is the modern Pesavento and Carney formalization.
Carney's strict version pins B at exactly 0.618; screeners typically allow a tolerance of a few percent on each ratio.
Stops beyond X and targets at retracements of AD are common usage conventions, not part of the pattern definition.
How traders use it
- As a pullback entry template: after an impulsive XA leg, traders project the 0.786 XA level and the AB=CD completion, wait for price to reach the zone at D, and look for confirmation such as a rejection candle or momentum shift before entering in the XA direction.
- For predefined risk: because D is projected in advance, stops commonly sit beyond the X point, where the pattern is objectively wrong, with initial targets at retracements of the AD swing, often the 0.382 and 0.618 levels.
- As a trend-following filter: many treatments only take Gartleys whose XA leg points with the higher-timeframe trend, using the pattern to time pullbacks rather than to call tops or bottoms.
- As a scan target: detectors such as LuxAlgo's Harmonic Pattern Detection test ZigZag pivots against ratio tolerances, standardizing the geometry but leaving results sensitive to pivot depth and tolerance settings.
- As confluence with a wave count: some traders rate a Gartley completion highly only when it coincides with a plausible correction ending under Elliott Wave Theory or a higher-timeframe level, stacking independent reasons at D.
Gartley vs neighboring harmonic patterns
Bat: Same XABCD retracement shape, different ratios: the Bat pairs a shallow B (0.50 of XA or less) with a deeper 0.886 D, while the Gartley pairs a 0.618 B with a 0.786 D. The B-point measurement usually decides the classification.
Butterfly: The Butterfly moves the 0.786 ratio to the B point and completes beyond the X extreme, typically at a 1.27 extension of XA; the Gartley completes inside the XA leg.
Crab: The Crab is the extreme case, completing far beyond X at the 1.618 extension of XA; the Gartley is its opposite pole, finishing inside the XA leg at the 0.786 retracement.
ABCD: The ABCD is the four-point symmetry embedded inside most Gartleys. A Gartley adds the X anchor and requires D to align with the 0.786 retracement of XA, not just with CD = AB.
Concept family
Elliott & Harmonics
33 concepts mapped · 33 in the Library
Gartley FAQ
Turn Gartley into a trading strategy.
Take the implementation from this page into Quant, then build on it, backtest it on real data, and keep refining it in conversation.
.png&w=3840&q=75)