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

DirectionXABCD
BullishLowHighLowHighLow (below X) → Buy
BearishHighLowHighLowHigh (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.

LegMeasurementTargetCheck Type
ABRetracement of XA0.382–0.618inRange
BCRetracement of AB0.382–0.886inRange
ADExtension of XA (beyond X)1.618isNear (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.