Gartley Pattern
The Gartley is a 5-point XABCD harmonic pattern. It is one of the original harmonic patterns and is characterised by a precise 0.618 AB retracement and a 0.786 AD retracement of the XA leg.
XABCD Structure
| Direction | X | A | B | C | D |
|---|---|---|---|---|---|
| Bullish | Low | High | Low | High | Low → Buy |
| Bearish | High | Low | High | Low | High → Sell |
The PRZ (Potential Reversal Zone) is the price band between C and D.
Fibonacci Ratios
FIB_TOLERANCE = 0.05 (5%) applies to all isNear checks.
| Leg | Measurement | Target | Check Type |
|---|---|---|---|
| AB | Retracement of XA | 0.618 | isNear (exact) |
| BC | Retracement of AB | 0.382–0.886 | inRange |
| AD | Retracement of XA | 0.786 | isNear (exact) |
Confidence
Confidence is the mean accuracy across the AB and AD legs:
confidence = 1 − (abError + adError) / 2
Clamped to [0, 1].
SL/TP
- SL: beyond X (or
prevSwingPriceif more extreme), ±0.1% buffer - TP1: D + 0.382 × |A − D|
- TP2: D + 0.618 × |A − D|
- TP3: A price
Levels are scalable via per-pattern TradingConfig multipliers. See TP Level Calculation.