# Head & Shoulders

Head & Shoulders is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

Detects head and shoulders tops and inverse bottoms from confirmed swings, validating prior trend, shoulder symmetry and neckline tilt before drawing the outline, S/H/S labels and neckline. A pattern completes only on a close through the neckline within 100 bars; breaks, retests, failures and measured objectives are all labeled and alertable, with low-volume breaks flagged.

- Indicator in the LuxAlgo Library, by LuxAlgo, published May 2, 2026.
- Access: free.
- Concepts: [Head & Shoulders](https://www.luxalgo.com/library/concept/head-and-shoulders/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=yu3myr7pu5gq49hcu2gpg5yd
- Page: https://www.luxalgo.com/library/indicator/head-and-shoulders/

**Head & Shoulders** is the definitive clean detector for the [head and shoulders](https://www.luxalgo.com/library/concept/head-and-shoulders/) reversal and its inverse. Candidates must pass explicit geometry (the head the extreme peak, shoulders roughly symmetric in height and duration on the pattern side of the neckline, tilt capped) before the outline and dashed neckline are drawn. Nothing is a signal until price closes through the neckline: the break freezes the line, projects the head-to-neckline height as a measured objective, and tags breaks lacking volume expansion.

## How to Trade the Head & Shoulders?

- **Pattern Forming alert**: the right shoulder just confirmed, a scenario, not yet a trade.
- **Neckline break**: a decisive close completes the pattern; a Break (low vol) tag flags a move without volume expansion.
- **Retest event**: the first return to the broken neckline without reclaiming it, the entry many traders prefer over chasing the break.
- **Failed label**: consecutive closes back through the neckline, or a close beyond the right shoulder, end the trade premise.

Every stage carries its own alert, from forming to objective.

## Head & Shoulders Settings

- **Swing Length** (default 10): bars each side a pivot must dominate; larger finds wider, slower patterns.
- **Require Prior Trend** (default enabled): only accept patterns reversing an established trend.
- **Shoulder Symmetry Tolerance %** (default 50): maximum shoulder height and leg-duration asymmetry.
- **Neckline Tilt Limit %** (default 50): maximum neckline drift as a share of pattern height.
- **Completion Window (Bars)** (default 100): bars allowed for the neckline close-through.
- **Reclaim Bars For Failure** (default 2): closes back through the neckline that declare a failed break.
- **Flag Low Volume Breaks** (default enabled): compare break volume against its 20-bar average.
- **Style toggles**: outline, S/H/S labels, measured objective and event labels, all on.

## Frequently Asked Questions

### How does a Head & Shoulders differ from a Triple Top?
A [triple top](https://www.luxalgo.com/library/indicator/triple-top-bottom/) prints three peaks near a shared level; the head and shoulders demands the middle peak stand above both shoulders. That higher-high-then-failure sequence is the pattern's argument.

### Why did a forming pattern disappear from the chart?
Price traded through the head before completion, the completion window expired without a neckline close-through, the right shoulder extended and the shape no longer passes the geometry checks, or a newer pattern replaced it. Each discards the shape.

### Is the measured objective a reliable price target?
It is the classical measured move (pattern height projected from the break) better used as a scenario or a scale-out point. The build tracks it either way: Target hit when reached, Failed when the neckline is reclaimed first.

## Related indicators

- [N Bar Reversal Detector](https://www.luxalgo.com/library/indicator/n-bar-reversal-detector/) (Key Reversal): markdown at https://www.luxalgo.com/library/indicator/n-bar-reversal-detector.md
- [Bart Pattern](https://www.luxalgo.com/library/indicator/bart-pattern/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/bart-pattern.md
- [Wolfe Wave Detector](https://www.luxalgo.com/library/indicator/wolfe-wave-detector/) (Wolfe Waves): markdown at https://www.luxalgo.com/library/indicator/wolfe-wave-detector.md
- [Island Reversal](https://www.luxalgo.com/library/indicator/island-reversal/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/island-reversal.md
- [McDonald's Pattern](https://www.luxalgo.com/library/indicator/mcdonalds-pattern/) (Double Top/bottom): markdown at https://www.luxalgo.com/library/indicator/mcdonalds-pattern.md
- [Diamond Top/bottom](https://www.luxalgo.com/library/indicator/diamond-top-bottom/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/diamond-top-bottom.md
- [Horns Pattern Identifier](https://www.luxalgo.com/library/indicator/horns-pattern-identifier/) (Rare Reversal Patterns): markdown at https://www.luxalgo.com/library/indicator/horns-pattern-identifier.md
- [Half Cup](https://www.luxalgo.com/library/indicator/half-cup/) (Rounding Top/bottom): markdown at https://www.luxalgo.com/library/indicator/half-cup.md

---

Source: https://www.luxalgo.com/library/indicator/head-and-shoulders/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
