Average True Range (ATR)

Get the Average True Range (ATR) history of a futures trading pair on an exchange, with a customizable candlestick interval and window length (default 14). Useful for measuring volatility, setting stop-loss distances and backtesting volatility strategies.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Available on these API plans: Startup Standard Professional Enterprise

Update frequencyReal-time

Response Data

data is an array sorted by time from earliest to latest; each element is the ATR for one candle, and time is the start time of the candle's interval (milliseconds). ATR is in the same unit as the trading pair's price (e.g., USDT for BTCUSDT), not a percentage. If the time range does not contain enough candles to start the calculation, an empty array [] is returned.

📘

The indicator needs some candles to start the calculation

ATR first needs earlier candles to start the calculation, so the first window − 1 candles in the time range produce no output. With interval=1h, window omitted (default 14) and a start/end range covering 60 candles, 47 records are returned, and the first one starts at the 14th candle; when the range covers only 3 candles, an empty array is returned. If you need complete results from a given point in time, move start_time back by another window candles and trim the data yourself after you receive it.

200 · application/json · See the response example in the right panel.

FieldTypeAlways ReturnedDescription
codestringYesBusiness status code; "0" means success
msgstringNoResult message; may be omitted on success
dataarray of objectYesArray of ATR values, sorted by time from earliest to latest; an empty array when there are not enough candles to start the calculation
data[].timeinteger (int64)YesStart time of the candle's interval, timestamp in milliseconds (UTC)
data[].avg_true_range_valuenumberYesATR value: the Wilder-smoothed true range, in the same unit as the trading pair's price (e.g., USDT), not a percentage

API Plans

Endpoint access and available intervals are listed below. See API Plans for pricing.

API PlanAccessAvailable intervals (interval)
Hobbyist❌ No—
Startup✅ Yes30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 1w
Standard✅ YesAll intervals supported by this endpoint, starting at 1m
Professional✅ YesAll intervals supported by this endpoint, starting at 1m
EnterpriseAs agreed in your authorizationAs agreed in your authorization

Choose only values listed in this page’s interval parameter; an arbitrary value above the minimum is not necessarily supported. These restrictions concern sampling or calculation intervals, not update frequency or available history length.

Different API plans can query different lengths of history; if start_time is earlier than the range you can query, it is automatically changed to the earliest time available. For how far back each interval's history can be queried, see Intervals.

Use This Endpoint with AI

Pick a task and click Open in ChatGPT or Open in Claude: the AI reads this page first and then gives you the result. You can also click Copy and paste the full prompt into the AI tool you use.

Get data with Python
Have AI write a Python function that gets the daily ATR of Binance BTCUSDT for the last 30 days.
Alert on rising volatility
Have AI write a script that prints an alert when ATR rises sharply.
Understand this endpoint
Have AI explain the parameters, the calculation start rule and the response fields in plain language.

This endpoint provides data through the REST API. Use the prompts above to have AI write the request code. For the tools available through MCP, see CoinGlass MCP.

Use Cases

ScenarioDescription
Measure VolatilityThe larger the ATR, the more volatile the price; use it to compare the volatility of the same trading pair across different periods.
Set Stop-Loss DistancesSet stop losses at a multiple of ATR so that the stop-loss distance adjusts automatically with market volatility.
Position SizingReduce position size when volatility is high and increase it moderately when volatility is low, so that the risk taken on each trade stays more stable.
Strategy BacktestingAlign with Pair Price OHLC History by time to backtest ATR-based breakout or stop-loss rules.

Related Endpoints

EndpointHow It Differs
Coin Average True Range List (ATR)Current ATR for multiple coins across 8 intervals
Bollinger Bands (BOLL)Another type of volatility indicator
Exponential Moving Average (EMA)EMA history for the same trading pair
Pair Price OHLC HistoryThe price candles used to calculate the indicator
Supported Exchanges and PairsLook up valid values for exchange and symbol

FAQ

Why are fewer records than limit returned, with the first one later than start_time?

ATR first needs earlier candles to start the calculation, so the first window − 1 candles produce no output. With window=14 (the default) and a start/end range covering 60 1-hour candles, 47 records are returned, and the first one is 13 hours later than start_time. Move start_time back by an extra window candles.

Why did I get an empty array?

When the time range does not contain enough candles to start the calculation, {"code":"0","data":[]} is returned. This happens when the start/end range covers only 3 candles; widen the time range or increase limit.

What is window if omitted?

The default is 14, so the calculation uses 14 candles. Pass a positive integer (at least 1); 0 and negative numbers are not valid window lengths.

What should I pass as symbol?

A trading pair, not a coin; for example, the BTC perpetual contract on Binance is BTCUSDT. Exchanges write pairs differently; go by what the Supported Exchanges and Pairs endpoint returns.

Learn More: Average True Range (ATR) Indicator

How Is ATR Calculated?

First calculate the True Range of each candle: take the largest absolute value among the candle's high minus its low, the difference between the high and the previous candle's close, and the difference between the low and the previous candle's close. Then average it over window candles with Wilder's smoothing method; the result is ATR.

What Window Length Should I Use for ATR?

14 is the most common setting and also this endpoint's default. The shorter the window, the more sensitive ATR is to recent volatility; the longer the window, the smoother the values and the better they represent the average level over a period.

How Can I View the ATR of Multiple Coins at Once?

Use Coin Average True Range List (ATR), which returns the current ATR of all coins across 8 intervals in one call.

Query Params
string
required
Defaults to Binance

Exchange name, e.g., Binance, OKX. For the exchanges you can query, see the Supported Exchanges and Pairs endpoint.

string
required
Defaults to BTCUSDT

Trading pair symbol, e.g., BTCUSDT. Exchanges write trading pairs differently; for the pairs you can query, see the Supported Exchanges and Pairs endpoint.

string
required
Defaults to 1d

Candlestick interval used to calculate the indicator, e.g., 1d. Options: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 1w.

Plan interval limits: this endpoint is not available on Hobbyist; Startup starts at 30m, and Standard and Professional at 1m; Enterprise follows your actual authorization. Only intervals supported by this endpoint are available.

integer
1 to 1000
Defaults to 1000

Number of candles used in the calculation, default 1000, accepts 1–1000. The endpoint calculates the indicator over limit candles; the first part of these candles (window − 1 of them) is used only to start the calculation and produces no output, so the number of records returned is usually less than limit. When both start_time and end_time are passed, the number of records returned is not guaranteed to correspond to limit.

int64

Start time, timestamp in milliseconds (UTC), e.g., 1790812800000 (2026-10-01 00:00 UTC). The candles used in the calculation satisfy start_time ≤ time < end_time: the start time is included and the end time is excluded. A start time that is not on an interval boundary is aligned to the next interval; if the start time is earlier than the history your API plan can query, or the range exceeds the maximum span of a single query, the start time is automatically moved later into the allowed range. The indicator first needs earlier candles to start the calculation, so the first returned record is later than start_time; if you need complete results from a given time, move start_time back by another window candles and trim the data yourself after you receive it.

int64

End time, timestamp in milliseconds (UTC), e.g., 1792022400000 (2026-10-15 00:00 UTC). The interval at the end time is not included; an end time later than the current time is treated as the current time. If both start and end times are omitted, the range ends at the current time and is calculated backward by interval × limit; if only start_time is passed, the end time is calculated as start_time + interval × limit.

integer
Defaults to 14

Window length for calculating ATR, in number of candles. The default is 14. Pass a positive integer (at least 1).

Response

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json