ATR Formula (Average True Range)

The mathematical formula for measuring market volatility using the Average True Range indicator.

The Formula

ATR = EMA(TR, period) using Wilder's smoothing
Where TR = max(H-L, |H-prev_C|, |L-prev_C|), default period = 14

Worked Example

ATR Example

TR values: 50, 45, 55, 60, 48
First ATR = average(TR) = 51.6
Next ATR = (prev_ATR x 13 + current_TR) / 14
This is Wilder's smoothing (similar to EMA with period*2-1)

Python Implementation

from gfil_calculators.instruments import calculate_atr
# ATR requires high/low/close arrays
# See the interactive calculator for full implementation

Try the Interactive Calculator

Free, no signup required

Open Calculator