Average true range

atrvolatilityForge API 1

The average true range over a period, Wilder smoothed or simple.

Inputs

NameTypeDefaultRange
periodint141 to 5000
methodchoicewilder

Outputs

NameTypeRequiredDescription
atrvalueOptionalcolor theme.accent, style line, width 1
Warm-up
period bars (14 at the defaults)
Repaints
No
Parity
TA-Lib, within 1e-9

Formula

TR[i] = max(high[i], close[i-1]) - min(low[i], close[i-1])

wilder: the first value is the mean of the first period true ranges, then ATR[i] = (ATR[i-1] * (period - 1) + TR[i]) / period

sma: the mean of the last period true ranges

No value until period true ranges exist.