Indicators›Chart patterns›Cup and Handle
GET/indicator/cupandhandle

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, 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.

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.

PointPriceTime (UTC)What it is
Left rim1,849.5415 Jun 12:00Swing high where the cup starts
Cup bottom1,512.0026 Jun 00:00Lowest low between the rims
Right rim1,807.654 Jul 16:00Swing high where the cup ends, within 2 ATR of the left rim
Handle bottom1,722.968 Jul 12:00Dip after the right rim, well above the cup bottom
Neckline1,849.54—The higher of the two rims
Breakout1,875.2214 Jul 12:00First 4-hour close above the neckline
Target2,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.

ETHUSDT daily candles with a Cup and Handle returned for June and July 2026 A cup from the left rim at 1849.54 on 15 June down to the cup bottom at 1512.00 on 26 June and back up to the right rim at 1807.65 on 4 July. The handle dipped to 1722.96, then a 4-hour candle closed at 1875.22 above the 1849.54 neckline on 14 July. Price stayed below the 2187.08 target until 19 August, after the period shown. 1,500 1,600 1,700 1,800 1,900 2,000 2,100 2,200 8 Jun 15 Jun 22 Jun 29 Jun 6 Jul 13 Jul 20 Jul 27 Jul Cup depth 337.54 Same depth Left rim 1849.54 Cup bottom 1512.00 Right rim 1807.65 Handle 1722.96 Breakout close 1875.22 1849.54 Neckline 2187.08 Target ETHUSDT · daily candles · pattern from timeframe=4h on Binance · Jun–Jul 2026
The shaded area is the cup, from rim to rim. The green line through the swings is 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.

SpecValue
EndpointGET https://v2.taapi.io/indicator/cupandhandle
Outputsh1_price, lmin_price, h2_price, handle_low_price, neckline_level, 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 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"

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.

200 OK
{
  "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]
}
FieldTypeDescription
h1_timestampinteger[]Unix time of the left rim, in seconds
h1_pricenumber[]Left rim: the swing high where the cup starts
lmin_timestampinteger[]Unix time of the cup bottom
lmin_pricenumber[]Cup bottom: the lowest low between the rims
h2_timestampinteger[]Unix time of the right rim
h2_pricenumber[]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_timestampsinteger[][]Times of every swing from the left rim to the right rim, for drawing the cup
cup_pivot_pricesnumber[][]Prices of those swings: wick highs and body lows
neckline_levelnumber[]The higher of the two rim highs. A close above it confirms the pattern
neckline_right_timestampinteger[]Where to end the neckline when drawing: the breakout candle, or the end of the breakout window
breakout_occurredboolean[]A candle closed above the neckline
is_confirmedboolean[]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
directionstring[]Always bullish
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

Status and status_reason

statusstatus_reasonMeaning
formingawaiting_breakoutThe cup is complete and price has not closed above the neckline yet
confirmedbreakout_above_necklineA candle closed above the neckline. Confirmation is permanent
invalidatedhandle_broke_cupBefore any breakout, the handle fell to the cup bottom
invalidatedbreakout_timeoutNo 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

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 retracement required to form a valid structural swing, expressed as a multiple of ATR.
deviationTypestringNoatrType of deviation filter to use: 'atr' (Average True Range) or 'percent'.
sourcestringNowickWhether to use 'wick' (high/low) or 'body' (open/close) prices for pivot detection.
heikinashibooleanNoFalseSet 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.
atrPeriodintegerNo14The lookback period used for the Average True Range (ATR) calculation if deviationType is 'atr'.
resultsintegerNo1Number of values to return, or max
backtrackintegerNo0Candles 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

PartRule
SwingsSwing highs and lows confirmed by depth, kept only if they move at least deviationATR × ATR from the previous swing
RimsTwo swing highs within about 2 ATR of each other
Cup bottomThe lowest swing low between the rims, at least 2 ATR below the neckline
ShapeAt 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
NecklineThe higher of the two rim highs
HandleThe lowest swing low after the right rim and before the breakout, with its candle body above the cup bottom
BreakoutThe first close above the neckline within 60 candles of the right rim
TargetNeckline + (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

SignalMeaningCondition
BreakoutPrice closed above the necklinestatus is confirmed
Setup to watchCup complete, waiting for the breakstatus is forming; watch for a close above neckline_level
TargetMeasured moveprojection_price
Fresh signalBreakout on the latest candlesbreakout_timestamp is close to timestamp
Failed setupPattern no longer validstatus 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"

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.

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": "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.

WSSwss://v2.taapi.io/streaming
{
  "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.

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