The mathematical formula for measuring market volatility using the Average True Range indicator.
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)
from gfil_calculators.instruments import calculate_atr # ATR requires high/low/close arrays # See the interactive calculator for full implementation