Docs

ta.atr

Size the typical bar to bar movement, for stops and position sizing.

itm
ta.atr(length, bars)

Average True Range of bars: Wilder's smoothing of ta.tr(). ta.atr(14, d) with d = series(timeframe="1d") is a daily average true range on any chart.

Parameters

A series parameter takes a value on every bar. A constant parameter must be known before the first bar, such as a number or an input.

NameKindTypeUnitDefaultRangeDescription
lengthConstantnumber-141 to 10000Window in observed bars.
barsConstantbarsbarsna-Which bars to read: a declared series, or na for the chart's own.

Output

NameTypeUnit
valuenumber-

Warm-up and missing values

Warm-up
length bars. Names in the warm-up are this operator’s parameters.
Missing values
Returns na until length consecutive non-na observations are in the window. An na resets the accumulation.

Example

itm
ta.atr(14)
itm
plot(ta.atr(14), "Average range 14")