Head and Shoulders Detection
Head and Shoulders Pattern identifies classic and inverse head and shoulders formations using swing-based recognition with dual-size scanning and configurable accuracy constraints. The indicator detects both single and double head/shoulder variants automatically.
Pattern Types

Classic Head and Shoulders (Bearish)
A classic H&S forms after an uptrend and signals a potential bearish reversal. The pattern consists of three peaks — a central higher peak (head) flanked by two lower peaks (shoulders). A neckline connects the reaction lows between the peaks. Breakout occurs when price closes below the neckline.
Inverse Head and Shoulders (Bullish)
An inverse H&S forms after a downtrend and signals a potential bullish reversal. The pattern consists of three troughs — a central deeper trough (head) flanked by two shallower troughs (shoulders). A neckline connects the reaction highs. Breakout occurs when price closes above the neckline.
Pattern Variants
The Head and Shoulders Pattern indicator detects multiple structural variants beyond the textbook formation:
- Single-top head — Standard single peak/trough at the head
- Double-top head — Two peaks/troughs forming the head (resembling a small double top/bottom within the H&S)
- Single shoulders — One peak/trough per shoulder
- Double shoulders — Two peaks/troughs per shoulder (wider, more complex formations)
Dual-Size Detection
The Head and Shoulders Pattern indicator runs two independent detection layers simultaneously. Each layer uses its own swing sensitivity.
| Layer | Default Size | Purpose |
|---|---|---|
| Pattern 1 | Very Small (5) | Shorter-term reversal patterns — more frequent detections |
| Pattern 2 | Medium (10) | Larger structural reversals — less frequent, more significant |
Pattern Size Presets:
| Preset | Swing Size |
|---|---|
| Tiny | 2 |
| Very Small (default) | 5 |
| Small | 7 |
| Medium | 10 |
| Large | 16 |
| Very Large | 20 |
| Huge | 30 |
| Custom | 1-300 |
Neckline Modes
The Head and Shoulders Pattern indicator offers two neckline calculation methods:
| Mode | Default | How It Works |
|---|---|---|
| Sloped (default) | On | Connects the actual swing points at their true price levels, producing an angled neckline |
| Straight | Off | Draws a horizontal neckline — simpler geometry, requires more symmetric patterns |
Sloped necklines better represent asymmetric patterns where the two shoulders form at different price levels. Straight necklines are useful for textbook-style formations where horizontal precision matters.
Accuracy Control
The Accuracy setting controls how strictly the pattern geometry must conform to ideal proportions — including shoulder symmetry, head prominence, and neckline alignment.
| Preset | Value | What It Does |
|---|---|---|
| Very Low (default) | 0 | Most permissive — detects the widest range of H&S formations |
| Low | 25 | Relaxed constraints |
| Medium | 50 | Balanced detection quality |
| High | 75 | Stricter geometric requirements |
| Very High | 100 | Most strict — only near-ideal symmetry qualifies |
| Custom | 0-100 | Manual control |
Log Scale
The Head and Shoulders Pattern indicator uses logarithmic scale by default for all internal calculations. Log scale normalizes the pattern geometry across different price levels, ensuring consistent detection quality on any instrument.
| Setting | Default | What It Controls |
|---|---|---|
| Log Scale | On | Whether calculations use logarithmic or linear price scale |
Breakout Confirmation
A breakout is confirmed when price closes beyond the neckline:
- Classic H&S → price closes below the neckline (bearish breakout)
- Inverse H&S → price closes above the neckline (bullish breakout)

Upon breakout, the Head and Shoulders Pattern indicator automatically calculates entry, stop loss, and up to three take profit levels. The neckline color indicates the pattern direction — pink for classic (bearish) and blue for inverse (bullish).
FAQ
How does the Head and Shoulders Pattern detect patterns?
The Head and Shoulders Pattern indicator uses swing-based recognition to identify the three-peak structure. Two independent detection sizes run simultaneously at different swing sensitivities. The indicator validates shoulder symmetry, head prominence, and neckline geometry against configurable accuracy constraints.
What is the difference between straight and sloped necklines?
A straight neckline draws a horizontal line connecting the two trough points (or peak points for inverse H&S). A sloped neckline connects the actual swing points at their true price levels, producing an angled neckline that better represents asymmetric patterns where the two sides form at different levels.
What accuracy level should I use for head and shoulders patterns?
The Head and Shoulders Pattern indicator defaults to Very Low accuracy, which detects the most patterns with looser geometric constraints. Increase accuracy to Medium or High for stricter shoulder symmetry and neckline alignment. Higher accuracy produces fewer but more structurally precise patterns.
Does the indicator detect double-top head variants?
Yes, the Head and Shoulders Pattern indicator detects both single-top and double-top head variants automatically. It also recognizes single and double shoulder configurations on both sides, covering a wide range of real-world H&S formations.