Head shoulders bearish setup event
Marks a bearish head-and-shoulders setup, but at default settings the head test can never pass, so it never fires.
Tracks a bearish head-and-shoulders shape against the 100-bar high and low. It steps through a left shoulder near the high, a pullback, a head that must close above the high by head_eps, a second pullback, and a right shoulder near the high. It marks the right shoulder and does not check the neckline. Its last state has no exit, so one run marks at most one setup.
How to read it
- Markers appear only on the candle where price returns near the 100-bar high after the second pullback.
- A marker means the setup is armed, not a sell: the neckline is never checked, so price may still be above the lows.
- At default settings the chart shows no marker, because the head test cannot pass.
- Any negative head_eps lets it fire, but then the head only means price is near the high, not above it.
What it outputs
- Bearish H&S setup
- Fires once, when the right shoulder completes near the 100-bar high with the neckline still unchecked. Drawn as markers on the candles where it fires.
When it fires
Fires once per run, on the bar the right shoulder returns within shoulder_eps of the 100-bar high, before any neckline break. The state never resets, so later setups in the same run are ignored. At default settings it never fires.
Settings
- shoulder_eps
- How close to the 100-bar high a shoulder must close, as a fraction of price. Raising it loosens the shoulder test, so more peaks count. Lowering it demands a near-exact touch of the high. Negative values never register a shoulder, so nothing fires.
- head_eps
- How far the head must close above the 100-bar high. At zero or more the test cannot pass, since the high includes the current bar, so nothing fires. Negative values only need a close near the high, which lets it fire.
- pullback
- How far price must fall off the 100-bar high, or sit within that fraction of the 100-bar low, before the next peak counts. Raising it demands a deeper dip. Zero or below removes the dip requirement, since every close is at or below the high.
Pitfalls
- At head_eps zero or above it never fires. The head must close above a high that already includes the current bar, so the test cannot pass.
- It marks at most one setup per run, since the final state has no exit. On SPY one-minute bars for September 2026, the default fired zero times and each loosened preset fired once.
- The neckline is never checked, so the marker does not confirm a breakdown. Pair it with a close below the recent lows before acting.