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,confirmedorinvalidated, with astatus_reasonthat 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.
| Point | Price | Time (UTC) | What it is |
|---|---|---|---|
| Left shoulder | 83,158.00 | 19 Oct 04:00 | A new swing high in the uptrend |
| First trough | 81,200.00 | 20 Oct 00:00 | The pullback after it: left end of the neckline |
| Head | 84,898.00 | 21 Oct 16:00 | A higher high, 1,740 above the left shoulder |
| Second trough | 80,939.54 | 22 Oct 16:00 | The pullback after the head: right end of the neckline |
| Right shoulder | 82,060.88 | 23 Oct 12:00 | A lower high, 1,097 below the left shoulder |
| Neckline at breakout | 80,793.03 | 24 Oct 04:00 | The line through both troughs, extended to the breakout candle |
| Breakout | 80,732.01 | 24 Oct 04:00 | First 4-hour close below the neckline |
| Target | 76,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.
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.
| Spec | Value |
|---|---|
| Endpoint | GET https://v2.taapi.io/indicator/headandshoulders |
| Outputs | h1_price, h2_price, h3_price, l1_price, l2_price, the neckline points, breakout_price, projection_price, status, status_reason and more |
| Markets | Binance, Binance Futures, Bybit, Gate.io, Kraken and US stocks |
| Timeframes | 1m to 1w |
| Delivery | REST, 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"
import requests
resp = requests.get(
'https://v2.taapi.io/indicator/headandshoulders',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={'exchange': 'binance', 'symbol': 'BTCUSDT', 'timeframe': '1h'},
)
print(resp.json())const params = new URLSearchParams({"exchange": "binance", "symbol": "BTCUSDT", "timeframe": "1h"});
const res = await fetch(`https://v2.taapi.io/indicator/headandshoulders?${params}`, {
headers: { Authorization: 'Bearer YOUR_API_KEY' },
});
console.log(await res.json());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.
{
"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_price81,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_h281,037.21. The pattern height ish2_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, sostatusisconfirmed. 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.
| Field | Type | Description |
|---|---|---|
h1_timestamp, h1_price | integer[], number[] | Left shoulder: Unix time in seconds, and the swing high |
l1_timestamp, l1_price | integer[], number[] | First trough, between the left shoulder and the head |
h2_timestamp, h2_price | integer[], number[] | Head: the highest of the three peaks |
l2_timestamp, l2_price | integer[], number[] | Second trough, between the head and the right shoulder |
h3_timestamp, h3_price | integer[], number[] | Right shoulder. A price above it before the breakout invalidates the pattern |
neckline_left_timestamp, neckline_left_price | integer[], number[] | Left end of the neckline: the first trough |
neckline_right_timestamp, neckline_right_price | integer[], 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_h2 | number[] | The neckline directly under the head. h2_price minus this is the pattern height |
breakout_occurred, is_confirmed | boolean[] | 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 |
direction | string[] | Always bearish |
status | string[] | forming, confirmed or invalidated |
status_reason | string[] | Why the pattern has that status; see the table below |
pattern_index | integer[] | Position of the pattern in the full list, oldest first |
timestamp | integer[] | 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
| status | status_reason | Meaning |
|---|---|---|
forming | awaiting_breakout | The right shoulder is in place and price has not closed below the neckline yet |
confirmed | breakout_below_neckline | A candle closed below the neckline within 20 candles of the right shoulder. Confirmation is permanent: what price does afterwards does not change it |
invalidated | bullish_structure_resumed | Before any breakout, price went above the right shoulder. Buyers are still in charge; a later break of the neckline is ignored |
invalidated | breakout_timeout | 20 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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
exchange | string | Yes | — | binance, binancefutures, bybit, gateio, kraken or stocks |
symbol | string | Yes | — | Pair or ticker, e.g. BTCUSDT or AAPL |
timeframe | string | Yes | — | 1m 5m 15m 1h 4h 1d 1w |
depth | integer | No | 10 | Width 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 |
deviationATR | number | No | 1 | Minimum move between two swings, in multiples of ATR (or percent with deviationType=percent). Smaller swings are merged |
deviationType | string | No | atr | atr or percent, the unit of deviationATR |
source | string | No | wick | wick uses highs and lows for the swings and the neckline; body uses open and close |
heikinashi | boolean | No | false | Detect 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 |
atrPeriod | integer | No | 14 | Period of the ATR that all the thresholds below are measured in |
headProminenceATR | number | No | 1.2 | How far, in ATR, the head must rise above each shoulder |
shoulderToleranceATR | number | No | 1.5 | Largest allowed difference between the two shoulders, in ATR |
minDepthATR | number | No | 1 | Minimum drop, in ATR, from the left shoulder to the first trough and from the head to the second |
symmetryMin | number | No | 0.5 | Minimum ratio of candles from left shoulder to head, over candles from head to right shoulder |
symmetryMax | number | No | 3.5 | Maximum of that ratio |
breakoutLookahead | integer | No | 20 | Candles after the right shoulder to wait for a close below the neckline |
necklineBuffer | number | No | 0.2 | How far, in ATR, a candle may close below the neckline between the first trough and the right shoulder before the pattern is rejected |
results | integer | No | 1 | Number of patterns to return, or max |
backtrack | integer | No | 0 | Candles 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
| Part | Rule |
|---|---|
| Swings | Swing highs and lows confirmed by depth, kept only if they move at least deviationATR × ATR from the previous swing |
| Sequence | Five swings in a row: a higher high (left shoulder), a higher low, a higher high (head), any low, and a lower high (right shoulder) |
| Uptrend | At least one earlier higher high and one earlier higher low in the candles |
| Head | At least 1.2 ATR above each shoulder |
| Shoulders | Within 1.5 ATR of each other |
| Troughs | Each at least 1 ATR below the peak before it |
| Timing | Left shoulder to head takes between 0.5 and 3.5 times as many candles as head to right shoulder |
| Right shoulder | The rally into it is smaller than the rally into the head |
| Neckline | A straight line through the two troughs. No candle between the first trough and the right shoulder closes more than 0.2 ATR below it |
| Breakout | The first close below the neckline within 20 candles of the right shoulder, as long as no candle went above the right shoulder first |
| Target | Neckline 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
| Signal | Meaning | Condition |
|---|---|---|
| Breakdown | Price closed below the neckline | status is confirmed |
| Fresh signal | Breakdown on the latest candles | breakout_timestamp is close to timestamp |
| Setup to watch | Three peaks in place, waiting for the break | status is forming; watch for a close below the neckline |
| Target | Measured move | projection_price |
| Stop | Where the pattern is clearly wrong | Above h3_price, the right shoulder |
| Failed setup | Pattern no longer valid | status 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"
import requests
API = 'https://v2.taapi.io'
HEADERS = {'Authorization': 'Bearer YOUR_API_KEY'}
market = {'exchange': 'binance', 'symbol': 'BTCUSDT', 'timeframe': '4h', 'backtrack': 1}
CANDLE = 4 * 3600 # seconds per candle for this timeframe
FRESH = 6 # only act on breakouts from the last 6 closed candles
p = requests.get(f'{API}/indicator/headandshoulders', headers=HEADERS, params=market).json()
def neckline_at(t):
"""The sloped neckline at Unix time t."""
t0, y0 = p['neckline_left_timestamp'][0], p['neckline_left_price'][0]
t1, y1 = p['neckline_right_timestamp'][0], p['neckline_right_price'][0]
return y0 + (y1 - y0) * (t - t0) / (t1 - t0)
if not p or not p.get('status'):
print('No head and shoulders in the candles')
elif p['status'][0] != 'confirmed':
print('Latest pattern:', p['status'][0], p['status_reason'][0])
else:
now = p['timestamp'][0] # the last closed candle
age = (now - p['breakout_timestamp'][0]) // CANDLE
if age > FRESH:
print(f'Breakout is {age} candles old, too late to act on')
else:
print(f"Short signal, breakout {age} candles ago at {p['breakout_price'][0]:,.2f}")
print(f"Target: {p['projection_price'][0]:,.2f}")
print(f"Stop: above the right shoulder, {p['h3_price'][0]:,.2f}")
print(f"Neckline: {neckline_at(now):,.2f} now; a close back above it is a warning")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 2026 | NVDA 1d, November 2025 | |
|---|---|---|
| Shoulders / head | 83,158 / 84,898 / 82,061 | 195.62 / 212.19 / 198.60 |
| Neckline | Slightly falling, 81,200 → 80,940 | Slightly rising, 176.21 → 178.91 |
| Breakout close vs neckline | 80,732 vs 80,793 (24 Oct) | 180.05 vs 180.71 (21 Nov) |
| Target | 76,932 | 146.17 |
| What followed | Back to 81,971 on 29 Oct, under the right shoulder; target reached 30 Oct; 72,611 on 12 Nov | Low 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
headProminenceATRandshoulderToleranceATRto find more, less clean patterns. - A long wick on one of the troughs tilts the neckline. Use
source=bodyif 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=truefor 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.
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.
{
"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.
Related indicators
- Inverse Head and Shoulders: the bullish mirror
- Double Top: two peaks instead of three
- Advanced Bearish Patterns: all bearish chart patterns in one call
See the full list of indicators, or start for free.