Functions
talib.atr()
Function atr (average true range) returns the RMA of true range. True range is max(high - low, abs(high - close[1]), abs(low - close[1])).
Syntax
talib.atr(series int length) → series float
Arguments
length required series int Length (number of bars back). Return Type
series float Example
indicator("ATR Indicator", overlay=false)
// Define ATR length
atrLength = input(14, title="ATR Length")
// Calculate ATR
atrValue = talib.atr(atrLength)
// Plot ATR
plot(atrValue, color=color.blue, title="ATR", linewidth=2)