Double Top & Double Bottom
Double Top and Double Bottom are classic reversal structure patterns. They signal exhaustion after two attempts to break the same price level. Detection uses five swing points (X, A, B, C, D) where X and B form the matching peaks or troughs.
Constant: DOUBLE_TOP_TOLERANCE = 0.03 (3%)
Double Top (Bearish)
Price makes two highs at roughly the same level, separated by a pullback (the neckline).
| Point | Role |
|---|---|
| X | First high (peak 1) |
| A | Pullback low (neckline valley) |
| B | Second high (peak 2 ≈ X) |
| C | Second low (confirms breakdown) |
| D | Final high used internally |
Validity: |X − B| / X ≤ 3% — both peaks must be within 3% of each other.
PRZ: ±0.2% band around A (the neckline).
Confidence: 1 − priceDiff / tolerance where priceDiff = |X − B| / X.
Double Bottom (Bullish)
Mirror image of Double Top.
| Point | Role |
|---|---|
| X | First low (trough 1) |
| A | Bounce high (neckline peak) |
| B | Second low (trough 2 ≈ X) |
| C | Second high (confirms breakout) |
| D | Final low used internally |
Validity: |X − B| / X ≤ 3% — both troughs within 3%.
PRZ: ±0.2% band around A (the neckline).
SL/TP
SL and TPs use the measured move (patternHeight = |A − X|):
- Double Top — SL: above the higher of X or B, ±0.1%; TP1: neckline − 0.5×height; TP2: neckline − 1×height; TP3: neckline − 1.5×height
- Double Bottom — SL: below the lower of X or B, ±0.1%; TP1: neckline + 0.5×height; TP2: neckline + 1×height; TP3: neckline + 1.5×height
Levels are scalable via per-pattern TradingConfig multipliers. See TP Level Calculation.
Related
- Head & Shoulders — related reversal structure
- Swing Point Detection
- Markets — Pattern Detection Overview