atr

forge.tafunctionSince Forge API 1
Functionpython
forge.ta.atr(high: ArrayLike,low: ArrayLike,close: ArrayLike,period: int = 14,method: str = 'wilder') -> np.ndarray

Average true range, Wilder smoothed (wilder) or a simple mean (sma).

Parameters

NameTypeDefault
highArrayLike
lowArrayLike
closeArrayLike
periodint14
methodstr'wilder'

Indicator: Average true range

Both start from the true range of bar 1, so the first value is on bar period. After a missing bar the average restarts with a fresh warm-up.

Classpython
forge.ta.ATR(**inputs: Any) -> None

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

Inputs

NameTypeDefaultRange
periodint141 to 5000
methodchoicewilder

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.