Crab Pattern
The Crab is a 5-point XABCD harmonic pattern and the most extreme extension pattern — D reaches a precise 1.618 extension of the XA leg beyond X. Like the Butterfly, D is the most extreme price point, so the stop-loss is placed beyond D.
XABCD Structure
| Direction | X | A | B | C | D |
|---|---|---|---|---|---|
| Bullish | Low | High | Low | High | Low (below X) → Buy |
| Bearish | High | Low | High | Low | High (above X) → Sell |
The PRZ 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.382–0.618 | inRange |
| BC | Retracement of AB | 0.382–0.886 | inRange |
| AD | Extension of XA (beyond X) | 1.618 | isNear (exact) |
Confidence
Confidence is based on the AD leg only:
confidence = 1 − adError
Clamped to [0, 1].
SL/TP
Because D extends beyond X, the SL is placed beyond D — not beyond X.
- SL: beyond D, ±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.
Related
- Butterfly Pattern — also an extension pattern; uses 1.27–1.618 range vs Crab’s exact 1.618
- Swing Point Detection
- Markets — Pattern Detection Overview