GET
/indicator/doubletop
DOUBLETOP
Category: Pattern Recognition - Advanced
Double Top is a bearish reversal pattern with two peaks at approximately the same price level, forming an 'M' shape and signaling the end of an uptrend.
Common parameters
All indicator requests share these parameters. See Single Indicator for details.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
exchange | string | Yes | — | Exchange identifier, e.g. binance, bybit. |
symbol | string | Yes | — | Trading pair, e.g. BTCUSDT. |
timeframe | string | Yes | — | Candle interval: 1m, 5m, 15m, 1h, 4h, 1d, 1w. |
results | integer | No | 1 | Number of historical values. Use max for all available. |
backtrack | integer | No | 0 | Candles to skip from most recent. |
Indicator parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
depth | integer | No | 10 | Lookback and lookforward period for pivot detection. Controls the width of structural swings. |
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 | True | Set to true to calculate pivots based on smoothed Heikin-Ashi candles rather than raw market prices. |
atrPeriod | integer | No | 14 | The lookback period used for the Average True Range (ATR) calculation if deviationType is 'atr'. |
topToleranceATR | number | No | 0.75 | Maximum allowed price difference between the two tops, normalized by ATR. |
minHeightATR | number | No | 1.5 | Minimum required height of the pattern (first top down to neckline valley), normalized by ATR. |
symmetryMin | number | No | 0.3 | Minimum ratio of time spent forming the left side vs the right side of the pattern. |
symmetryMax | number | No | 4 | Maximum ratio of time spent forming the left side vs the right side of the pattern. |
breakoutLookahead | integer | No | 20 | Number of candles to look ahead after the second top to confirm a breakdown. |
necklineBuffer | number | No | 0.1 | ATR-based buffer below the neckline to filter out false breakdowns during formation. |
Example
curl -G https://v2.taapi.io/indicator/doubletop \ -H "Authorization: Bearer YOUR_API_KEY" \ --data-urlencode "exchange=binance" \ --data-urlencode "symbol=BTCUSDT" \ --data-urlencode "timeframe=1h" \ --data-urlencode "depth=10" \ --data-urlencode "deviationATR=1" \ --data-urlencode "deviationType=atr" \ --data-urlencode "source=wick" \ --data-urlencode "heikinashi=True" \ --data-urlencode "atrPeriod=14" \ --data-urlencode "topToleranceATR=0.75" \ --data-urlencode "minHeightATR=1.5" \ --data-urlencode "symmetryMin=0.3" \ --data-urlencode "symmetryMax=4" \ --data-urlencode "breakoutLookahead=20" \ --data-urlencode "necklineBuffer=0.1"
const res = await fetch(
'https://v2.taapi.io/indicator/doubletop?exchange=binance&symbol=BTCUSDT&timeframe=1h',
{ headers: { Authorization: 'Bearer YOUR_API_KEY' } }
);
const data = await res.json();
import requests
resp = requests.get(
'https://v2.taapi.io/indicator/doubletop',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={'exchange': 'binance', 'symbol': 'BTCUSDT', 'timeframe': '1h'}
)
print(resp.json())
Response
Results are always wrapped in arrays, even when only one value is returned.
200 OK
{
"h1_timestamp": [1708300800],
"h1_price": [0.0],
"l1_timestamp": [1708300800],
"l1_price": [0.0],
"h2_timestamp": [1708300800],
"h2_price": [0.0],
"neckline_level": [0.0],
"neckline_right_timestamp": [1708300800],
"breakout_neckline_price": [0.0],
"breakout_occurred": [0.0],
"is_confirmed": [0.0],
"breakout_timestamp": [1708300800],
"breakout_price": [0.0],
"projection_price": [0.0],
"direction": [0.0],
"status": [0.0],
"status_reason": [0.0],
"pattern_index": [0.0],
"timestamp": [1708300800]
}
Errors
Response
{
"h1_timestamp": [1708300800],
"h1_price": [0.0],
"l1_timestamp": [1708300800],
"l1_price": [0.0],
"h2_timestamp": [1708300800],
"h2_price": [0.0],
"neckline_level": [0.0],
"neckline_right_timestamp": [1708300800],
"breakout_neckline_price": [0.0],
"breakout_occurred": [0.0],
"is_confirmed": [0.0],
"breakout_timestamp": [1708300800],
"breakout_price": [0.0],
"projection_price": [0.0],
"direction": [0.0],
"status": [0.0],
"status_reason": [0.0],
"pattern_index": [0.0],
"timestamp": [1708300800]
}Data is being fetched. Retry after 1–2 seconds.
Response
{ "pending": true, "key": "ta:binance:BTCUSDT:1h:doubletop:..." }Response
{ "error": "Missing required: exchange, symbol, timeframe" }Response
{ "error": "Invalid or missing API key." }Response
{ "error": "Rate limit exceeded. Your plan allows 30 requests per 15 seconds." }