Head and Shoulders

The head and shoulders top and its inverse as one node: three swings, a neckline, a close through it. Sensitivity sets how strict the shape is.

IndicatorBy AlgoLiftUpdated 6 min read
On this page 11What it measuresFormulaInputs in AlgoLiftOutputs in AlgoLiftHow to read itBest in, worst inThree setups1. Neckline break with a momentum check2. Measured-move exits3. Only patterns that formed quicklyCommon mistakes

TL;DR. A head and shoulders is three swings with the middle one the extreme: a left shoulder, a deeper head, and a right shoulder at about the left one's price, with a neckline drawn through the two highs (or lows) between them. The Head and Shoulders node finds the inverse pattern at a low, which breaks up, and the top at a high, which breaks down. It fires once on the bar that closes through the neckline and hands you the neckline, a measured-move target and a stop. One Sensitivity setting decides how strict the shape must be.

What it measures

  • A reversal. At a low, price makes a low, a lower low, then a higher low that fails to reach the head. A close above the neckline says the sellers have lost the swing.
  • Both directions in one node. The inverse head and shoulders breaks up; the head and shoulders top is the same shape upside down and breaks down. The node's breakout reads +1 for the inverse pattern and -1 for the top.
  • Once per pattern. The breakout fires on one bar and the pattern ends. Another breakout needs a new right shoulder.

Formula

Inputs in AlgoLift

SettingDefaultRangeNotes
Sensitivity51 to 10How strict the shape is. 1 finds only the cleanest patterns, 10 the loosest; 5 is the textbook shape. Every setting below moves with it.
Longest pattern8010 to 500 barsThe most bars from the left shoulder to the breakout.
Target (% of height)10010 to 500The target's distance past the neckline, in percent of the head's distance from it. 100 is the classic measured move.
SettingsFrom SensitivityFrom Sensitivity, CustomCustom unlocks the five settings below and reads them as you set them.
Swings of4 bars each side1 to 50Swing strength. Step 1: 5, steps 6 to 10: 3.
Head at least0.75 ATR deeper0 to 20How far the head must reach beyond both shoulders. Step 1: 1.5, step 10: 0.2.
Shoulders within1.0 ATR0 to 20How far apart the shoulders may be. Step 1: 0.5, step 10: 2.0.
Neckline peaks within1.5 ATR0 to 20How far apart the neckline's two peaks may be. Step 1: 0.5, step 10: 4.0.
Breaks by0.05 ATR0 to 5How far past the neckline a close must be. Step 1: 0.15, steps 7 to 10: 0.

Outputs in AlgoLift

HandleTypePlottedNotes
BreakoutNumericAlways+1 on an inverse head and shoulders' breakout bar, -1 on a top's, 0 elsewhere. Wire it into a Comparison (greater than 0 for longs, less than 0 for shorts).
Inverse head and shoulders breakout, Head and shoulders top breakoutNumericOn select1 on that side's breakout bar, else 0.
StageNumericOn select0 none, 1 a head has formed, 2 armed (the right shoulder is confirmed and a close through the neckline would break out). Positive for the inverse pattern, negative for the top.
Breakout levelNumericAlwaysThe armed pattern's neckline at the bar.
Pattern high, Pattern lowNumericOn selectThe pattern's range since the left shoulder.
Target, StopNumericOn selectThe last breakout's measured move and its right shoulder, held until the next breakout.
Bars formingNumericOn selectBars since the left shoulder.

How to read it

  • Stage 2: the right shoulder is confirmed and the neckline is drawn. A close through it is the signal.
  • Stage 1: a head has formed below the swing before it, and the node is waiting for a right shoulder.
  • A neckline that disappears without a marker: a new swing formed, price closed back through the right shoulder, or the pattern ran longer than its limit.
  • Few signals: raise Sensitivity one step at a time and watch the count. Each step loosens every rule together, so the shape stays coherent.
Common Misconception
Myth
A head and shoulders predicts a reversal.
Reality
It describes one that may have started. Many complete patterns fail to reach their target, and on intraday bars a loose step calls ordinary chop a pattern. Test the step you trade on months it was not chosen on.

Best in, worst in

Best in markets that have trended for a while and start to make lower highs (for a top) or higher lows (for the inverse), where the neckline is a level other traders watch too.

Worst in tight ranges, where three similar swings appear constantly and the neckline is broken back and forth.

Three setups

1. Neckline break with a momentum check

Wire Breakout into a Comparison (greater than 0) and require the RSI above 50 into a long Entry. Mirror it with less than 0 and RSI below 50 for shorts.

2. Measured-move exits

Set a Bracket Order with its target at the node's Target and its stop at the node's Stop, so every trade's exits come from its own pattern.

3. Only patterns that formed quickly

Add a Comparison that Bars forming at the breakout is below 50, so slow, drawn-out patterns are skipped.

Common mistakes

  • Expecting the signal at the right shoulder. The node waits for the shoulder to be confirmed (Swings of bars later) and then for a close through the neckline. Entering at the shoulder is a different, earlier trade.
  • Loosening several rules at once. Move Sensitivity one step, not five separate settings. If you need one rule different, switch Settings to Custom and change only that one.
  • Choosing Sensitivity on the backtest you report. Pick it on one window and check it on another (overfitting in trading).
Key Takeaway

The Head and Shoulders node finds three swings with the head the extreme, draws the neckline through the highs between them, and fires once when a close breaks it, in both directions. Sensitivity sets how strict the whole shape is with one number.