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 returns h1 timestamp, h1 price, lmin timestamp, lmin price values for the Cup and Handle indicator as JSON, for crypto pairs and US stocks. Send an exchange, symbol and timeframe to get real-time or historical data, with no candles to download and no calculations to maintain.

SpecValue
EndpointGET https://v2.taapi.io/indicator/cupandhandle
Outputsh1_timestamp, h1_price, lmin_timestamp, lmin_price, h2_timestamp, h2_price 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

This response came from the live API on 9 November 2026. Long lists are shortened here.

200 OK
{
  "h1_timestamp": [1792897200],
  "h1_price": [81033.69],
  "lmin_timestamp": [1792983600],
  "lmin_price": [79368.67],
  "h2_timestamp": [1793026800],
  "h2_price": [80844.7],
  "handle_low_timestamp": [null],
  "handle_low_price": [null],
  "cup_pivot_timestamps": [[1792897200, 1792918800, 1792947600, 1792983600, 1793005200, 1793019600, 1793026800]],
  "cup_pivot_prices": [[81033.69, 80328.32, 80951.57, 79580.52, 80575.45, 79702.63, 80844.7]],
  "neckline_level": [81033.69],
  "neckline_right_timestamp": [1793156400],
  "breakout_occurred": [true],
  "is_confirmed": [true],
  "breakout_timestamp": [1793156400],
  "breakout_price": [81055.9925],
  "breakout_neckline_price": [81033.69],
  "projection_price": [82698.71],
  "direction": ["bullish"],
  "status": ["confirmed"],
  "status_reason": ["breakout_above_neckline"],
  "pattern_index": [6],
  "timestamp": [1794218400]
}

This response can be null or empty when there is nothing to report for the requested candles, so handle that case in your code.

FieldTypeDescription
h1_timestampnumber[]Unix timestamp of the left rim of the cup (H1).
h1_pricenumber[]Price level at the left rim of the cup (H1).
lmin_timestampnumber[]Unix timestamp of the lowest point at the bottom of the cup (Lmin).
lmin_pricenumber[]Price level at the lowest point of the cup (Lmin).
h2_timestampnumber[]Unix timestamp of the right rim of the cup (H2).
h2_pricenumber[]Price level at the right rim of the cup (H2).
handle_low_timestamparrayUnix timestamp of the lowest point within the handle.
handle_low_pricearrayPrice level at the lowest point within the handle.
cup_pivot_timestampsarrayArray of timestamps plotting the interior zigzag path of the cup's U-shape.
cup_pivot_pricesarrayArray of prices plotting the interior zigzag path of the cup's U-shape.
neckline_levelnumber[]The price level of the horizontal resistance neckline (highest wick between H1 and H2).
neckline_right_timestampnumber[]Timestamp denoting where the neckline extends to on the right.
breakout_occurredboolean[]Boolean flag (true/false) indicating if price successfully broke above the neckline.
is_confirmedboolean[]Explicit boolean flag (true/false) indicating if the Cup and Handle pattern is fully confirmed (synonymous with breakout_occurred).
breakout_timestampnumber[]Unix timestamp of the candle that triggered the confirmation breakout.
breakout_pricenumber[]The closing price of the candle that triggered the confirmation breakout.
breakout_neckline_pricenumber[]The specific price of the neckline at the exact moment of the breakout.
projection_pricenumber[]The theoretical upside price target calculated by adding the cup's depth to the neckline.
directionstring[]The inherent bias of the pattern. Always 'bullish' for a standard Cup and Handle.
statusstring[]The current state of the pattern: 'forming', 'confirmed', or 'invalidated'.
status_reasonstring[]Context detailing why the pattern holds its current status (e.g. 'awaiting_breakout').
pattern_indexnumber[]A sequential integer index uniquely identifying this specific pattern instance.
timestampinteger[]Unix time of each candle, in seconds

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
depthintegerNo10Lookback and lookforward period for pivot detection. Controls the width of structural swings.
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.
heikinashibooleanNoTrueSet to true to calculate pivots based on smoothed Heikin-Ashi candles rather than raw market prices.
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 Cup and Handle?

Cup and Handle, popularised by William O'Neil, is a bullish continuation pattern: a rounded base followed by a small pullback before a breakout. The endpoint returns the cup's highs and low, the handle, the neckline and a projected target.

Cup and Handle formula

OutputCalculation
TargetNeckline + depth of the cup

How to read Cup and Handle in your code

SignalMeaningCondition
Forming or confirmedDetection statusstatus and is_confirmed
BreakoutPrice closed above the necklinebreakout_occurred is true
TargetMeasured-move projectionprojection_price

Limitations: Geometric pattern detection depends on pivot settings, so tune deviationATR and depth or lookback values on your own market. 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 to return a series for backtesting or charting. The last element is the most recent 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 "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?

It returns h1_timestamp, h1_price, lmin_timestamp, lmin_price, h2_timestamp, h2_price, handle_low_timestamp, handle_low_price, cup_pivot_timestamps, cup_pivot_prices, neckline_level, neckline_right_timestamp, breakout_occurred, is_confirmed, breakout_timestamp, breakout_price, breakout_neckline_price, projection_price, direction, status, status_reason, pattern_index, plus a timestamp for the request. Results are JSON.

Is the latest Cup and Handle value final?

No. The newest value belongs to the candle still forming and can change until it closes. Add backtrack=1 to read the last closed candle.

Which Cup and Handle settings can I change?

You can set depth, deviationATR, deviationType, source, heikinashi, 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.