Make the shoulder and head rules measurable
The preceding rise supplies the reversal context. Three peaks in an existing decline do not establish the same hypothesis. For a custom detector, use one swing-selection rule throughout and specify both price tolerance and spacing. The following hypothetical specification uses standard price candles and arithmetic prices; its thresholds are examples, not TradingView defaults or recommended settings.
- For this example, keep the latest five alternating pivots. Before candidate creation, replace consecutive same-side pivots only with a more extreme one; if a bar qualifies as both a high and a low, skip it. Freeze the five points once the candidate becomes eligible.
- A right shoulder at 62 would fail the stated shoulder tolerance even though it remains below the head. Raising the tolerance afterward would change the detector.
- The head-to-neckline height must be positive. A percentage of that height is different from a percentage of the stock price; label the denominator.
- A fixed 3-unit prominence filter will behave differently on stocks with different price levels. Any percentage or volatility-based replacement needs its own specification and test.
| Decision | Illustrative rule | Example |
|---|---|---|
| Prior rise | Left shoulder is at least 10% above the lowest low of the preceding 20 bars; all 20 bars must exist | A prior low of 50 and left shoulder of 60 pass |
| Swing sequence | Use five alternating confirmed extremes; each must be strictly beyond the three bars on each side, with ties rejected | High 60, low 55, high 66, low 57, high 60.5 |
| Head prominence | Head exceeds both shoulders by at least 3 price units | 66 - 60.5 = 5.5 passes |
| Shoulder tolerance | Absolute shoulder difference is at most 15% of the head-to-neckline height measured at the head bar | Height 10 gives tolerance 1.5; difference 0.5 passes |
| Spacing | Each shoulder-to-head interval is 10 to 30 bars | Shoulders at bars 10 and 50, head at 30: both intervals are 20 |