Indicators›Chart patterns›Head and Shoulders
GET/indicator/headandshoulders

Head and Shoulders

Category: Chart patterns · Updated November 2026


The TAAPI.IO Head and Shoulders API finds the bearish Head and Shoulders: three peaks with the middle one highest, sitting on a floor called the neckline. When price closes below the neckline, the uptrend that built the peaks is considered over. It works on crypto pairs and US stocks. Send an exchange, symbol and timeframe, with no candles to download and no pattern logic to maintain.

What one request returns

  • The shape: the left shoulder, head and right shoulder (h1_*, h2_*, h3_*) and the two troughs between them (l1_*, l2_*), so you can draw the pattern.
  • The neckline: a sloped line through the two troughs, given as two points (neckline_left_*, neckline_right_*), plus its value under the head.
  • The breakout and target: the candle that closed below the neckline, its close, the neckline at that candle, and projection_price, one pattern height below.
  • The status: forming, confirmed or invalidated, with a status_reason that says why.

The default returns the most recent pattern. Add results=max to get every pattern found in the candles, oldest first. The mirror image, a bullish bottom, is the Inverse Head and Shoulders.

Example: BTCUSDT, October 2026

Request: BTCUSDT on 4-hour Binance candles with the default settings. This is the pattern it returned on 12 November 2026.

PointPriceTime (UTC)What it is
Left shoulder83,158.0019 Oct 04:00A new swing high in the uptrend
First trough81,200.0020 Oct 00:00The pullback after it: left end of the neckline
Head84,898.0021 Oct 16:00A higher high, 1,740 above the left shoulder
Second trough80,939.5422 Oct 16:00The pullback after the head: right end of the neckline
Right shoulder82,060.8823 Oct 12:00A lower high, 1,097 below the left shoulder
Neckline at breakout80,793.0324 Oct 04:00The line through both troughs, extended to the breakout candle
Breakout80,732.0124 Oct 04:00First 4-hour close below the neckline
Target76,932.24—Neckline at breakout − (head − neckline under the head) = 80,793.03 − 3,860.79

How to interpret this: Bitcoin pushed to a new high of 83,158, pulled back, then pushed higher again to 84,898. That second push is the head. The third push stalled at 82,060, below the left shoulder: buyers could no longer make new highs. The two pullbacks between the peaks bottomed at nearly the same price, 81,200 and 80,940, and the line through them is the neckline. On 24 October a 4-hour candle closed at 80,732, just below it, and the API marked the pattern confirmed. The measured move takes the height of the head above the neckline, 3,861, and subtracts it from the neckline at the breakout, which gives 76,932. It was not a straight line down: on 29 October price climbed back to 81,971, above the neckline and within 90 of the right shoulder, before falling through the target the next day.

BTCUSDT 4-hour candles with the Head and Shoulders returned for October 2026 Left shoulder at 83,158 on 19 October, head at 84,898 on 21 October and right shoulder at 82,060.88 on 23 October. The neckline runs through the troughs at 81,200 and 80,939.54 and slopes slightly down. A 4-hour candle closed at 80,732.01 below the neckline (80,793.03) on 24 October at 04:00. The target of 76,932.24 is one pattern height below the neckline and was reached on 30 October. 76,000 77,000 78,000 79,000 80,000 81,000 82,000 83,000 84,000 85,000 18 Oct 21 Oct 24 Oct 27 Oct 30 Oct Left shoulder 83,158 Head 84,898 Right shoulder 82,061 Height 3,861 Breakout close 80,732 Same height Target reached 30 Oct 80,793 Neckline at breakout 76,932 Target BTCUSDT · 4-hour candles · Binance · 17 – 31 Oct 2026
The red line joins the five swings. The solid line is the neckline through the two troughs, up to the breakout candle. The dashed brackets show the pattern height under the head and the same height below the breakout, where the dotted target line sits.

The right shoulder is only known 5 candles after it prints (with the default depth of 10), so this pattern first appeared on 24 October at 08:00, already confirmed. Price reaching the target here does not mean it always will; see a pattern that failed. Example for illustration only, not financial advice.

SpecValue
EndpointGET https://v2.taapi.io/indicator/headandshoulders
Outputsh1_price, h2_price, h3_price, l1_price, l2_price, the neckline points, breakout_price, projection_price, status, status_reason and more
MarketsBinance, Binance Futures, Bybit, Gate.io, Kraken and US stocks
Timeframes1m to 1w
DeliveryREST, bulk and WebSocket

Get Head and Shoulders with one API call

This request returns Head and Shoulders for BTCUSDT on 1-hour Binance candles. Add your API key to run it here.

curl -G https://v2.taapi.io/indicator/headandshoulders \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "exchange=binance" \
  --data-urlencode "symbol=BTCUSDT" \
  --data-urlencode "timeframe=1h"

Head and Shoulders API response

Example for BTCUSDT on 4-hour Binance candles: the pattern charted above, from a results=max request on 12 November 2026. It was the only pattern in the candles.

200 OK
{
  "h1_timestamp": [1792382400],
  "h1_price": [83158],
  "l1_timestamp": [1792454400],
  "l1_price": [81200],
  "h2_timestamp": [1792598400],
  "h2_price": [84898],
  "l2_timestamp": [1792684800],
  "l2_price": [80939.54],
  "h3_timestamp": [1792756800],
  "h3_price": [82060.88],
  "neckline_left_timestamp": [1792454400],
  "neckline_left_price": [81200],
  "neckline_right_timestamp": [1792814400],
  "neckline_right_price": [80793.03124999999],
  "neckline_at_h2": [81037.2125],
  "breakout_occurred": [true],
  "is_confirmed": [true],
  "breakout_timestamp": [1792814400],
  "breakout_price": [80732.01],
  "breakout_neckline_price": [80793.03124999999],
  "projection_price": [76932.24374999998],
  "direction": ["bearish"],
  "status": ["confirmed"],
  "status_reason": ["breakout_below_neckline"],
  "pattern_index": [1],
  "timestamp": [1794484800]
}

Reading this response

  • The neckline starts at the first trough (neckline_left_price 81,200 = l1_price) and passes through the second trough at 80,939.54. That is a drop of 260.46 over 16 candles, about 16.28 per 4-hour candle.
  • Under the head, 10 candles after the left anchor, the neckline is at neckline_at_h2 81,037.21. The pattern height is h2_price − neckline_at_h2 = 84,898 − 81,037.21 = 3,860.79.
  • The breakout candle is 25 candles after the left anchor, where the neckline is at 80,793.03 (breakout_neckline_price). Its close, 80,732.01, is below that, so status is confirmed.
  • projection_price = 80,793.03 − 3,860.79 = 76,932.24.
  • Because the pattern is confirmed, neckline_right_* is the breakout candle. To get the neckline at any other time, extend the line through the two neckline points.
FieldTypeDescription
h1_timestamp, h1_priceinteger[], number[]Left shoulder: Unix time in seconds, and the swing high
l1_timestamp, l1_priceinteger[], number[]First trough, between the left shoulder and the head
h2_timestamp, h2_priceinteger[], number[]Head: the highest of the three peaks
l2_timestamp, l2_priceinteger[], number[]Second trough, between the head and the right shoulder
h3_timestamp, h3_priceinteger[], number[]Right shoulder. A price above it before the breakout invalidates the pattern
neckline_left_timestamp, neckline_left_priceinteger[], number[]Left end of the neckline: the first trough
neckline_right_timestamp, neckline_right_priceinteger[], number[]Right end of the neckline when drawing: the breakout candle if confirmed, the candle that invalidated it, or 20 candles after the right shoulder
neckline_at_h2number[]The neckline directly under the head. h2_price minus this is the pattern height
breakout_occurred, is_confirmedboolean[]true once a candle closed below the neckline
breakout_timestamp(integer or null)[]Unix time of that candle
breakout_price(number or null)[]Its close
breakout_neckline_price(number or null)[]The neckline at the breakout candle. breakout_price is always below it
projection_price(number or null)[]Target: breakout_neckline_price − (h2_price − neckline_at_h2). Set only when confirmed
directionstring[]Always bearish
statusstring[]forming, confirmed or invalidated
status_reasonstring[]Why the pattern has that status; see the table below
pattern_indexinteger[]Position of the pattern in the full list, oldest first
timestampinteger[]Unix time of the latest candle used

Prices are swing highs and lows on candle wicks. With source=body they are candle bodies instead (the higher of open and close for peaks, the lower for troughs), and the neckline goes through the trough bodies.

Status and status_reason

statusstatus_reasonMeaning
formingawaiting_breakoutThe right shoulder is in place and price has not closed below the neckline yet
confirmedbreakout_below_necklineA candle closed below the neckline within 20 candles of the right shoulder. Confirmation is permanent: what price does afterwards does not change it
invalidatedbullish_structure_resumedBefore any breakout, price went above the right shoulder. Buyers are still in charge; a later break of the neckline is ignored
invalidatedbreakout_timeout20 candles after the right shoulder and still no close below the neckline

The API checks each candle after the right shoulder in order, and the first event decides: a high above the right shoulder, or a close below the neckline. Once decided, the status stays the same as new candles arrive. The default results=1 returns only the last pattern, which can be invalidated. Add results=max to get every pattern and filter on status. The response is empty when no pattern is found in the candles, so handle that case in your code. To get only valid patterns merged with other bearish patterns, use Advanced Bearish Patterns, which leaves invalidated ones out.

Head and Shoulders API parameters

NameTypeRequiredDefaultDescription
exchangestringYes—binance, binancefutures, bybit, gateio, kraken or stocks
symbolstringYes—Pair or ticker, e.g. BTCUSDT or AAPL
timeframestringYes—1m 5m 15m 1h 4h 1d 1w
depthintegerNo10Width of the window that confirms a swing: half the candles before it, half after. With 10, a swing high must be the highest of 5 candles on each side, and appears 5 candles late. Raise it for larger, slower patterns
deviationATRnumberNo1Minimum move between two swings, in multiples of ATR (or percent with deviationType=percent). Smaller swings are merged
deviationTypestringNoatratr or percent, the unit of deviationATR
sourcestringNowickwick uses highs and lows for the swings and the neckline; body uses open and close
heikinashibooleanNofalseDetect the pattern on smoothed Heikin-Ashi candles instead of real candles. Fewer small swings, but breakouts confirm later and may not match a normal chart
atrPeriodintegerNo14Period of the ATR that all the thresholds below are measured in
headProminenceATRnumberNo1.2How far, in ATR, the head must rise above each shoulder
shoulderToleranceATRnumberNo1.5Largest allowed difference between the two shoulders, in ATR
minDepthATRnumberNo1Minimum drop, in ATR, from the left shoulder to the first trough and from the head to the second
symmetryMinnumberNo0.5Minimum ratio of candles from left shoulder to head, over candles from head to right shoulder
symmetryMaxnumberNo3.5Maximum of that ratio
breakoutLookaheadintegerNo20Candles after the right shoulder to wait for a close below the neckline
necklineBuffernumberNo0.2How far, in ATR, a candle may close below the neckline between the first trough and the right shoulder before the pattern is rejected
resultsintegerNo1Number of patterns to return, or max
backtrackintegerNo0Candles to skip from the most recent

What is the Head and Shoulders?

The Head and Shoulders is a bearish reversal pattern that forms at the end of an uptrend. Price makes a high (the left shoulder), pulls back, makes a higher high (the head), pulls back again, and then rallies once more but stops below the head (the right shoulder). The two pullbacks mark a floor, the neckline. As long as price stays above it, the uptrend is only pausing. A close below it says the buyers who held the floor twice have given up.

How traders use it

Most traders wait for the close below the neckline rather than selling the right shoulder, because many right shoulders turn into new highs. On the break they sell or go short, put a stop above the right shoulder, and aim for the measured move: the distance from the head down to the neckline, projected down from the breakout. Some wait for price to come back up and retest the neckline from below, and use that for a better entry. The pattern is a reversal signal only when there was a trend to reverse; three peaks in a sideways range mean much less.

How the API finds it

PartRule
SwingsSwing highs and lows confirmed by depth, kept only if they move at least deviationATR × ATR from the previous swing
SequenceFive swings in a row: a higher high (left shoulder), a higher low, a higher high (head), any low, and a lower high (right shoulder)
UptrendAt least one earlier higher high and one earlier higher low in the candles
HeadAt least 1.2 ATR above each shoulder
ShouldersWithin 1.5 ATR of each other
TroughsEach at least 1 ATR below the peak before it
TimingLeft shoulder to head takes between 0.5 and 3.5 times as many candles as head to right shoulder
Right shoulderThe rally into it is smaller than the rally into the head
NecklineA straight line through the two troughs. No candle between the first trough and the right shoulder closes more than 0.2 ATR below it
BreakoutThe first close below the neckline within 20 candles of the right shoulder, as long as no candle went above the right shoulder first
TargetNeckline at the breakout − (head − neckline under the head)

The ATR is measured at the swing being tested, so the same defaults work on a 1-minute chart and a weekly one. The numbers in the table are the defaults; each has a parameter above.

How to read Head and Shoulders in your code

SignalMeaningCondition
BreakdownPrice closed below the necklinestatus is confirmed
Fresh signalBreakdown on the latest candlesbreakout_timestamp is close to timestamp
Setup to watchThree peaks in place, waiting for the breakstatus is forming; watch for a close below the neckline
TargetMeasured moveprojection_price
StopWhere the pattern is clearly wrongAbove h3_price, the right shoulder
Failed setupPattern no longer validstatus is invalidated; see status_reason

Act on a fresh Head and Shoulders breakdown with Python

This reads the latest pattern as of the last closed 4-hour candle (backtrack=1) and only acts on a breakdown from the last few candles. It uses projection_price as the target, the right shoulder as the stop, and the sloped neckline as an early warning.

curl -G https://v2.taapi.io/indicator/headandshoulders \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "exchange=binance" \
  --data-urlencode "symbol=BTCUSDT" \
  --data-urlencode "timeframe=4h" \
  --data-urlencode "backtrack=1"

Why the age check: the right shoulder is only known depth/2 candles after it prints, so a fast breakdown can already be a few candles old the first time you see the pattern. In the BTC example above it was one candle old. Decide how late is too late for your strategy.

A pattern that worked and one that failed

Two confirmed patterns from the default settings, both clean on a chart.

BTCUSDT 4h, October 2026NVDA 1d, November 2025
Shoulders / head83,158 / 84,898 / 82,061195.62 / 212.19 / 198.60
NecklineSlightly falling, 81,200 → 80,940Slightly rising, 176.21 → 178.91
Breakout close vs neckline80,732 vs 80,793 (24 Oct)180.05 vs 180.71 (21 Nov)
Target76,932146.17
What followedBack to 81,971 on 29 Oct, under the right shoulder; target reached 30 Oct; 72,611 on 12 NovLow of 169.55 on 25 Nov, then a rally; target never reached; back above the right shoulder on 25 Feb 2026

BTC never got back above the right shoulder after the break, although it came within 90 of it on 29 October. NVDA printed its right shoulder on 19 November and broke the neckline two days later, then found buyers at 169.55, 10.50 below the breakout close. The measured move asked for a fall of 34, about 19%, which a mega-cap stock rarely does in a straight line. A trader with a stop above 198.60 would have been taken out only three months later; a trader waiting for the target was waiting for a move that never came.

A third pattern never got that far. On SOLUSDT 4h in September 2026, one candle after the setup appeared, price rose above the right shoulder and the API marked it invalidated with bullish_structure_resumed. The next candle closed below the neckline, but by then the pattern was already invalid, so the API did not report that close as a breakout. That pattern has since dropped out of the response: a later swing redrew its right shoulder (see the limitations below).

How often the target is reached: across BTC, ETH and SOL at 1h, 4h and 1d, and AAPL, MSFT, NVDA, TSLA and SPY at 1h and 1d (500 candles each, default settings), the API confirmed 7 patterns, bearish and inverse together. 3 reached their target before price got back past the right shoulder; 4 did not. That is far too few to measure an edge. Treat the target as a reference level, not a promise.

Examples for illustration only, not financial advice.

Limitations:

  • Swings need depth/2 candles to confirm, so the right shoulder, and sometimes the breakout, appear with a delay.
  • The rules are strict. The left shoulder must be a new high, so a top whose left shoulder sits below an earlier spike is not found. The October 2025 Bitcoin top is one example: its left shoulder was below the August high. Loosen headProminenceATR and shoulderToleranceATR to find more, less clean patterns.
  • A long wick on one of the troughs tilts the neckline. Use source=body if you draw necklines through candle bodies.
  • Rarely, a swing that forms after a breakout redraws the right shoulder and the pattern is no longer returned. Store confirmed patterns on your side if you need a permanent record.
  • Patterns run on real candles; add heikinashi=true for smoothed candles, which find fewer small swings but confirm breakouts later.
  • A confirmed pattern is not a guaranteed move. Nothing on this page is financial advice.

Get historical Head and Shoulders values

Add results to return a series for backtesting or charting. The last element is the most recent candle.

curl -G https://v2.taapi.io/indicator/headandshoulders \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "exchange=binance" \
  --data-urlencode "symbol=BTCUSDT" \
  --data-urlencode "timeframe=1h" \
  --data-urlencode "results=100"

Get Head and Shoulders for multiple symbols

Combine Head and Shoulders with other indicators in one request. Each exchange, symbol and timeframe combination is one construct: Basic allows 1 per request, Pro 3 and Expert 10.

POST/bulk
curl -X POST https://v2.taapi.io/bulk \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "constructs": [
    {
      "id": "btc_1h",
      "exchange": "binance",
      "symbol": "BTCUSDT",
      "timeframe": "1h",
      "indicators": [
        {
          "id": "headandshoulders",
          "indicator": "headandshoulders"
        },
        {
          "id": "rsi",
          "indicator": "rsi"
        }
      ]
    }
  ]
}'

Stream Head and Shoulders in real time

Subscribe over WebSocket to receive new values every 5 seconds while the candle is forming. Streaming supports 1m, 5m, 15m and 1h, and uses interval where REST uses timeframe.

WSSwss://v2.taapi.io/streaming
{
  "type": "subscribe",
  "id": "headandshoulders",
  "exchange": "binance",
  "symbol": "BTCUSDT",
  "interval": "1m",
  "indicator": "headandshoulders"
}

Head and Shoulders API FAQ

What does the Head and Shoulders API return?

For each pattern: the three peaks and two troughs, the neckline as two points and under the head, the breakout candle and close, the target, and the status with its reason. The default returns the most recent pattern; results=max returns all of them. Results are JSON.

When is a pattern confirmed?

When a candle closes below the neckline within 20 candles of the right shoulder, before any candle has gone above the right shoulder. A wick below is not enough. Once confirmed, the status does not change. Add backtrack=1 to ignore the candle that is still forming.

How is the target calculated?

Take the height of the head above the neckline (h2_price − neckline_at_h2) and subtract it from the neckline at the breakout candle (breakout_neckline_price). The result is projection_price.

Why is the neckline sloped?

It is drawn through the two troughs, which are rarely at exactly the same price. A falling neckline means the second pullback went lower than the first; a rising one means it held higher. Use neckline_left_* and neckline_right_* to get its value at any time.

Why did I get no pattern?

Head and Shoulders tops are rare at the default settings: in 18 test data sets of 500 candles, the API found 2 bearish ones. Try a higher timeframe, results=max, or smaller headProminenceATR and larger shoulderToleranceATR values.

Can I get Head and Shoulders for US stocks?

Yes. Use exchange=stocks with a ticker such as AAPL. US stocks are included on the Pro plan and above.

See the full list of indicators, or start for free.