Functions
talib.atr()
Average true range over `length` bars. Read it as a measure of how far the market has been travelling, not as a price level. There is no `source` argument. The reading is built from the chart's own bars.
Syntax
talib.atr(series int length) → series float
Arguments
length required series int Length (number of bars back). Return Type
series float Example
//@lipi=2
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)