Shark Pattern
The Shark is a 5-point harmonic pattern with non-standard internal notation. The implementation maps the conventional XABCD labels to O, X, A, B, C (origin + 4 swing points), which means the ratio measurements differ from other harmonic patterns.
Point Mapping
| Standard label | Internal label | Role |
|---|---|---|
| X (origin) | O | Starting extreme |
| A | X | First swing |
| B | A | Intermediate swing |
| C | B | Extension peak/trough |
| D | C (entry) | Reversal entry point |
XABCD Structure
| Direction | O | X | A | B | C (entry) |
|---|---|---|---|---|---|
| Bullish | Low | High | Low | High (beyond O) | Low → Buy |
| Bearish | High | Low | High | Low (beyond O) | High → Sell |
The PRZ is the price band between B and C (the entry).
Fibonacci Ratios
FIB_TOLERANCE = 0.05 (5%) applies to all isNear checks.
| Measurement | Target | Check Type |
|---|---|---|
| |OB| / |OX| — how far B moved from O relative to the OX leg | 1.13–1.618 | inRange |
| XC retracement of XA (entry C relative to X→A leg) | 0.886 | isNear (exact) |
Confidence
Confidence is based on the XC retracement error only:
confidence = 1 − xcError
Clamped to [0, 1].
SL/TP
- SL: beyond X (the origin swing, equivalent to O), ±0.1% buffer
- TP1: C + 0.382 × |A − C|
- TP2: C + 0.618 × |A − C|
- TP3: A price
Levels are scalable via per-pattern TradingConfig multipliers. See TP Level Calculation.