Cup and Handle
Category: Chart patterns · Updated November 2026
The TAAPI.IO Cup and Handle API finds the bullish Cup and Handle: a rounded bottom where price falls from a ceiling, bottoms out and climbs back to the same ceiling, dips a little (the handle), and then closes above that ceiling. 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 and right rims (
h1_*,h2_*), the cup bottom (lmin_*), the handle bottom (handle_low_*) and every swing in between (cup_pivot_*), so you can draw the pattern. - The neckline:
neckline_level, the ceiling that has to break. - The breakout and target: the candle that closed above the neckline, its close, and
projection_price, the neckline plus the depth of the cup. - 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.
Example: ETHUSDT, June to July 2026
Request: ETHUSDT on 4-hour Binance candles with the default settings and results=max. This is one of the patterns it returned on 12 November 2026.
| Point | Price | Time (UTC) | What it is |
|---|---|---|---|
| Left rim | 1,849.54 | 15 Jun 12:00 | Swing high where the cup starts |
| Cup bottom | 1,512.00 | 26 Jun 00:00 | Lowest low between the rims |
| Right rim | 1,807.65 | 4 Jul 16:00 | Swing high where the cup ends, within 2 ATR of the left rim |
| Handle bottom | 1,722.96 | 8 Jul 12:00 | Dip after the right rim, well above the cup bottom |
| Neckline | 1,849.54 | — | The higher of the two rims |
| Breakout | 1,875.22 | 14 Jul 12:00 | First 4-hour close above the neckline |
| Target | 2,187.08 | — | Neckline + (neckline − cup bottom) = 1,849.54 + 337.54 |
How to interpret this: ETH fell from 1,849 in mid-June to 1,512 on 26 June, then spent the next week climbing back, reaching 1,807 on 4 July. Sellers pushed it down once more, but the dip stopped at 1,722, about a third of the way back into the cup. On 14 July a 4-hour candle closed at 1,875, above the 1,849 ceiling, and the API marked the pattern confirmed. The measured move adds the depth of the cup, 337, to the neckline, which gives 2,187. ETH did not get there straight away: it stalled below 2,000 in late July, and passed the target on 19 August.
cup_pivot_prices followed by the handle. The solid line is the neckline up to the breakout, and the upper dashed line is the target, one cup depth above it. Price passed the target on 19 August, after the period shown.Candles are combined into daily bars to keep the chart readable; the pattern itself comes from 4-hour candles. Price reaching the target here does not mean it always will. Example for illustration only, not financial advice.
| Spec | Value |
|---|---|
| Endpoint | GET https://v2.taapi.io/indicator/cupandhandle |
| Outputs | h1_price, lmin_price, h2_price, handle_low_price, neckline_level, 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 Cup and Handle with one API call
This request returns Cup and Handle for BTCUSDT on 1-hour Binance candles. Add your API key to run it here.
curl -G https://v2.taapi.io/indicator/cupandhandle \ -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/cupandhandle',
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/cupandhandle?${params}`, {
headers: { Authorization: 'Bearer YOUR_API_KEY' },
});
console.log(await res.json());Cup and Handle API response
Example for ETHUSDT on 4-hour Binance candles: the pattern charted above, taken from a live results=max response on 12 November 2026.
{
"h1_timestamp": [1781524800],
"h1_price": [1849.54],
"lmin_timestamp": [1782432000],
"lmin_price": [1512],
"h2_timestamp": [1783180800],
"h2_price": [1807.65],
"handle_low_timestamp": [1783512000],
"handle_low_price": [1722.96],
"cup_pivot_timestamps": [[1781524800, 1781798400, 1781956800, 1782072000, 1782129600, 1782201600, 1782288000, 1782432000, 1782561600, 1782676800, 1782748800, 1782820800, 1783180800]],
"cup_pivot_prices": [[1849.54, 1682.23, 1749.55, 1706.94, 1779.9, 1660.9, 1693.67, 1557.93, 1611.02, 1564.61, 1637.58, 1565.18, 1807.65]],
"neckline_level": [1849.54],
"neckline_right_timestamp": [1784030400],
"breakout_occurred": [true],
"is_confirmed": [true],
"breakout_timestamp": [1784030400],
"breakout_price": [1875.22],
"breakout_neckline_price": [1849.54],
"projection_price": [2187.08],
"direction": ["bullish"],
"status": ["confirmed"],
"status_reason": ["breakout_above_neckline"],
"pattern_index": [3],
"timestamp": [1794441600]
}| Field | Type | Description |
|---|---|---|
h1_timestamp | integer[] | Unix time of the left rim, in seconds |
h1_price | number[] | Left rim: the swing high where the cup starts |
lmin_timestamp | integer[] | Unix time of the cup bottom |
lmin_price | number[] | Cup bottom: the lowest low between the rims |
h2_timestamp | integer[] | Unix time of the right rim |
h2_price | number[] | Right rim: the swing high where the cup ends |
handle_low_timestamp | (integer or null)[] | Unix time of the handle bottom, or null if there is no handle yet or it dipped more than half the cup depth |
handle_low_price | (number or null)[] | Lowest candle body of the dip after the right rim, before the breakout |
cup_pivot_timestamps | integer[][] | Times of every swing from the left rim to the right rim, for drawing the cup |
cup_pivot_prices | number[][] | Prices of those swings: wick highs and body lows |
neckline_level | number[] | The higher of the two rim highs. A close above it confirms the pattern |
neckline_right_timestamp | integer[] | Where to end the neckline when drawing: the breakout candle, or the end of the breakout window |
breakout_occurred | boolean[] | A candle closed above the neckline |
is_confirmed | boolean[] | Same as breakout_occurred |
breakout_timestamp | (integer or null)[] | Unix time of the first close above the neckline |
breakout_price | (number or null)[] | Close of that candle |
breakout_neckline_price | (number or null)[] | Neckline level at the breakout (the neckline is flat) |
projection_price | (number or null)[] | Target: neckline + (neckline − cup bottom). Set only when confirmed |
direction | string[] | Always bullish |
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 |
Status and status_reason
| status | status_reason | Meaning |
|---|---|---|
forming | awaiting_breakout | The cup is complete and price has not closed above the neckline yet |
confirmed | breakout_above_neckline | A candle closed above the neckline. Confirmation is permanent |
invalidated | handle_broke_cup | Before any breakout, the handle fell to the cup bottom |
invalidated | breakout_timeout | No close above the neckline within 60 candles of the right rim |
The default results=1 returns only the last pattern in the list, 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 bullish patterns, use Advanced Bullish Patterns, which leaves invalidated ones out.
Cup and Handle 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 retracement required to form a valid structural swing, expressed as a multiple of ATR. |
deviationType | string | No | atr | Type of deviation filter to use: 'atr' (Average True Range) or 'percent'. |
source | string | No | wick | Whether to use 'wick' (high/low) or 'body' (open/close) prices for pivot detection. |
heikinashi | boolean | No | False | Set to true to 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 | The lookback period used for the Average True Range (ATR) calculation if deviationType is 'atr'. |
results | integer | No | 1 | Number of values to return, or max |
backtrack | integer | No | 0 | Candles to skip from the most recent |
What is the Cup and Handle?
The Cup and Handle is a bullish continuation pattern. Price falls from a ceiling in a rounded arc, bottoms out, and climbs back to about the same ceiling. A short, shallow dip follows: the handle. When price then closes above the ceiling, the pattern is complete, and traders often project a move up equal to the depth of the cup. The Inverse Cup and Handle is its bearish mirror.
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 |
| Rims | Two swing highs within about 2 ATR of each other |
| Cup bottom | The lowest swing low between the rims, at least 2 ATR below the neckline |
| Shape | At least 2 swings and 10 candles on each side of the cup bottom, and no swing high between the rims above the neckline, so a V or a W does not count |
| Neckline | The higher of the two rim highs |
| Handle | The lowest swing low after the right rim and before the breakout, with its candle body above the cup bottom |
| Breakout | The first close above the neckline within 60 candles of the right rim |
| Target | Neckline + (neckline − cup bottom) |
When several rim pairs give the same cup bottom, or several cups end at the same right rim, the API keeps one pattern: a valid one before an invalidated one, then the widest.
How to read Cup and Handle in your code
| Signal | Meaning | Condition |
|---|---|---|
| Breakout | Price closed above the neckline | status is confirmed |
| Setup to watch | Cup complete, waiting for the break | status is forming; watch for a close above neckline_level |
| Target | Measured move | projection_price |
| Fresh signal | Breakout on the latest candles | breakout_timestamp is close to timestamp |
| Failed setup | Pattern no longer valid | status is invalidated; see status_reason |
Limitations: Swings need depth/2 candles to confirm, so the right rim and handle appear with a delay. 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.
Read Cup and Handle from Python
Use backtrack=1 to read the result as of the last closed candle.
curl -G https://v2.taapi.io/indicator/cupandhandle \ -H "Authorization: Bearer YOUR_API_KEY" \ --data-urlencode "exchange=binance" \ --data-urlencode "symbol=BTCUSDT" \ --data-urlencode "timeframe=1h" \ --data-urlencode "backtrack=1"
import requests
resp = requests.get(
'https://v2.taapi.io/indicator/cupandhandle',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={'exchange': 'binance', 'symbol': 'BTCUSDT', 'timeframe': '1h', 'backtrack': 1},
)
data = resp.json()
print(data['l1_timestamp'])Get historical Cup and Handle values
Add results=max to return every pattern in the candles for backtesting or charting. Patterns are listed oldest first, so the last element is the most recent.
curl -G https://v2.taapi.io/indicator/cupandhandle \ -H "Authorization: Bearer YOUR_API_KEY" \ --data-urlencode "exchange=binance" \ --data-urlencode "symbol=BTCUSDT" \ --data-urlencode "timeframe=1h" \ --data-urlencode "results=100"
Get Cup and Handle for multiple symbols
Combine Cup and Handle 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": "cupandhandle",
"indicator": "cupandhandle"
},
{
"id": "rsi",
"indicator": "rsi"
}
]
}
]
}'Stream Cup and Handle 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": "cupandhandle",
"exchange": "binance",
"symbol": "BTCUSDT",
"interval": "1m",
"indicator": "cupandhandle"
}Cup and Handle API FAQ
What does the Cup and Handle API return?
For each pattern: the rims, the cup bottom, the handle bottom and the swings between them, the neckline, 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 above neckline_level after the right rim. A wick above is not enough. Once confirmed, the status does not change. Add backtrack=1 to ignore the candle that is still forming.
Which Cup and Handle settings can I change?
You can set depth, deviationATR, deviationType, source, heikinashi and atrPeriod. See the parameters table above for defaults.
Can I get Cup and Handle 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
See the full list of indicators, or start for free.