Average True Range (ATR)
Category: Volatility · Updated November 2026
The TAAPI.IO ATR API returns the Average True Range as JSON for crypto pairs and US stocks. Send an exchange, symbol and timeframe to get real-time or historical values, with no candles to download and no calculations to maintain.
What one request returns
- The ATR (
value): the average size of recent candles, gaps included, in the symbol's price units. - A series, with
results: one value per candle, oldest first, to see whether volatility is rising or falling. - ATR and price together, with
/bulk: add thepriceindicator to turn ATR into a stop distance and a position size.
So one call answers two questions: how far does this market move in a normal candle, and how much should you buy?
Example: volatility nearly tripled as NVDA fell, October to November 2026
Request: one /bulk call for NVDA on daily US stock candles, with the 14-day ATR and the closing price. Sent at 22:37 UTC on Saturday 14 November, so the latest candle is Friday's close.
| Value | NVDA | Reading |
|---|---|---|
| Close, 13 Nov | 161.01 | 33% below the 5 October close of 240.20 |
| ATR 14 | 11.76 | 7.3% of the price |
| ATR on 6 Oct | 6.02 | 2.5% of the price, a day after the high |
How to interpret this: ATR measures how far a market moves in a normal candle. On 6 October, the day after NVDA's high, its 14-day ATR was 6.02, or 2.5% of the price. By 13 November it was 11.76, or 7.3%, after daily swings such as −8.8% on 11 November and a 24.50-point range on 12 November. ATR has no direction: it rose because candles got bigger. That is exactly what risk sizing needs. A trader who puts the stop two ATRs below the entry and risks $1,000 per trade would have bought 83 shares on 6 October, a $19,908 position with the stop 5% away. On 13 November the same rule gives 42 shares, a $6,762 position with the stop 14.6% away. The amount at risk is the same, but the position is a third of the size, because each share now moves almost three times as far.
| Date | NVDA close | ATR 14 | Stop (close − 2 × ATR) | Shares for $1,000 risk | Position |
|---|---|---|---|---|---|
| 6 Oct | 239.86 | 6.02 (2.5%) | 227.83 | 83 | $19,908 |
| 13 Nov | 161.01 | 11.76 (7.3%) | 137.50 | 42 | $6,762 |
Values are from the production API on 14 November 2026, using daily candles. Position sizes ignore fees and gaps through the stop. Nothing here is financial advice.
| Spec | Value |
|---|---|
| Endpoint | GET https://v2.taapi.io/indicator/atr |
| Outputs | ATR value, timestamp |
| Default settings | Period 14 |
| Markets | Binance, Binance Futures, Bybit, Gate.io, Kraken and US stocks |
| Timeframes | 1m to 1w |
| Delivery | REST, bulk and WebSocket |
Get ATR with one API call
This request returns ATR for BTCUSDT on 1-hour Binance candles. Add your API key to run it here.
curl -G https://v2.taapi.io/indicator/atr \ -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/atr',
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/atr?${params}`, {
headers: { Authorization: 'Bearer YOUR_API_KEY' },
});
console.log(await res.json());ATR API response
This response came from the live API on 9 November 2026.
{
"value": [500.2279012682141],
"timestamp": [1794218400]
}| Field | Type | Description |
|---|---|---|
value | number[] | ATR result |
timestamp | integer[] | Unix time of each candle, in seconds |
ATR 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 |
period | integer | No | 14 | Number of candles in the average |
results | integer | No | 1 | Number of values to return, or max |
backtrack | integer | No | 0 | Candles to skip from the most recent |
What is ATR?
Average True Range, developed by J. Welles Wilder, measures volatility as the average size of candles, including gaps. It says nothing about direction and is widely used for stop distances and position sizing.
ATR formula
| Output | Calculation |
|---|---|
| True range | The largest of: high − low, |high − previous close|, |low − previous close| |
| ATR | (previous ATR × 13 + true range) ÷ 14 |
On 13 November NVDA traded between 158.39 and 171.48, after closing at 167.84 the day before. The largest of the three distances is the day's own range, 13.09. With the previous ATR at 11.65, the new ATR is (11.65 × 13 + 13.09) ÷ 14 = 11.76.
How to read ATR in your code
| Signal | Meaning | Condition |
|---|---|---|
| Volatility rising | Candles getting larger | value rising |
| Volatility falling | Candles getting smaller | value falling |
| Relative volatility | Comparable across symbols | value ÷ close × 100 |
| Stop distance | Common sizing method | Entry price − 2 × value for a long |
Limitations: ATR is in price units, so divide by the close, or use NATR, to compare symbols. Wilder's smoothing makes it react gradually to a sudden spike. Nothing on this page is financial advice.
Why ATR uses true range
A candle's high minus its low misses any gap from the previous close. True range takes the largest of three distances, so a market that jumps overnight still registers as volatile. That matters most for US stocks, which often open away from the prior close, and less for crypto, which trades around the clock.
Wilder then smooths true range over the period, 14 by default, so ATR moves gradually and doesn't fully reflect a sudden spike straight away.
Using ATR for risk
The main use of ATR is scaling decisions to current volatility. A fixed stop of 1% may be too tight in a volatile week and too loose in a quiet one, while a stop at a multiple of ATR adjusts by itself. Sizing positions from that distance keeps the amount at risk similar across markets.
ATR is in the symbol's price units, so a value of 500 on BTC and 5 on another pair can't be compared directly. Use NATR to compare volatility across symbols. SuperTrend and Keltner Channels are both built on ATR.
Calculate an ATR stop and position size with Python
The stop sits two ATRs below the entry, and the size is set so that hitting the stop loses a fixed amount. One /bulk request returns ATR and the close. It uses one construct, so it works on every plan. For crypto, or for stocks during market hours, add backtrack=1 to both indicators so you size from a closed candle.
curl -X POST https://v2.taapi.io/bulk \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"constructs": [
{
"id": "nvda_1d",
"exchange": "stocks",
"symbol": "NVDA",
"timeframe": "1d",
"indicators": [
{
"id": "atr",
"indicator": "atr"
},
{
"id": "close",
"indicator": "price"
}
]
}
]
}'import requests
payload = {
"constructs": [
{
"id": "nvda_1d",
"exchange": "stocks",
"symbol": "NVDA",
"timeframe": "1d",
"indicators": [
{
"id": "atr",
"indicator": "atr"
},
{
"id": "close",
"indicator": "price"
}
]
}
]
}
resp = requests.post(
'https://v2.taapi.io/bulk',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
json=payload,
)
data = resp.json()
risk = 1000 # dollars you accept to lose if the stop is hit
c = data['nvda_1d']
atr = c['atr']['value'][-1]
close = c['close']['value'][-1]
stop = close - 2 * atr
shares = int(risk // (2 * atr))
print(f'ATR {atr:.2f} ({atr / close * 100:.1f}% of price), stop {stop:.2f}, '
f'buy {shares} shares (${shares * close:,.0f})')The response at 22:37 UTC on 14 November. The script prints ATR 11.76 (7.3% of price), stop 137.50, buy 42 shares ($6,762)
{
"nvda_1d": {
"atr": {
"value": [11.755703012494775],
"timestamp": [1794528000]
},
"close": {
"value": [161.01],
"timestamp": [1794528000]
}
}
}Multiples between 1.5 and 3 ATRs are common. A smaller multiple keeps the stop closer and allows a larger position, but normal swings hit it more often. Whichever you choose, keep it the same across symbols, so the amount at risk stays comparable.
Get historical ATR 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/atr \ -H "Authorization: Bearer YOUR_API_KEY" \ --data-urlencode "exchange=binance" \ --data-urlencode "symbol=BTCUSDT" \ --data-urlencode "timeframe=1h" \ --data-urlencode "results=100"
Get ATR for multiple symbols
Combine ATR 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": "atr",
"indicator": "atr"
},
{
"id": "rsi",
"indicator": "rsi"
}
]
}
]
}'Stream ATR 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": "atr",
"exchange": "binance",
"symbol": "BTCUSDT",
"interval": "1m",
"indicator": "atr"
}Why ATR values can differ between platforms
- Smoothing: TAAPI.IO uses Wilder's smoothing, as in the formula above. Some charts offer a simple, exponential or weighted average instead.
- History: Wilder's average has a long memory, so the amount of earlier data behind a calculation matters.
- Exchange data: highs and lows differ between venues, particularly in wicks.
- Stock sessions: daily stock candles cover the regular session, so overnight gaps count through the previous close.
ATR API FAQ
What does the ATR API return?
An array of ATR values in value, in the symbol's price units, plus a timestamp for each candle.
How do I compare ATR across symbols?
Divide it by the close and multiply by 100 to get a percentage, as in the example above, or use the NATR endpoint, which returns that directly.
How do I use ATR for position size?
Set the stop a multiple of ATR from the entry, then size the position so that hitting the stop loses a fixed amount: shares = risk ÷ (multiple × ATR). See Calculate an ATR stop and position size with Python.
Is the latest ATR value final?
No. The newest value belongs to the candle still forming and grows as its range grows. Add backtrack=1 to read the last closed candle.
Can I get ATR for US stocks?
Yes. Use exchange=stocks with a ticker such as NVDA. US stocks are included on the Pro plan and above.
Related indicators
- Normalized ATR (NATR): ATR as a percentage of price
- SuperTrend: a trailing line built from ATR
- Keltner Channels: bands built from ATR
- Bollinger Bands: volatility from standard deviation
Build with ATR on Binance, Bybit or US stocks. Start for free or browse all 262 indicators.