ATR — Average True Range
What it measures: Volatility (average per-bar swing distance)
When to use it: Sizing SL/TP to market conditions: SL = k×ATR widens automatically when the market gets more volatile. On XAUUSD, ATR is a real $ distance (H1 is typically ~$3-8). Also useful as a filter for erratic markets: ATR > 3× its average = skip
Typical period: 14
Caution: ATR doesn't indicate direction — it's magnitude only, always pair it with a directional indicator
Formula the engine actually uses
TR = max(high−low, |high−prev_close|, |low−prev_close|); ATR = TR.ewm(alpha=1/period, adjust=False).mean()
smoothing: Wilder RMA — ewm(alpha=1/period), not SMA · warmup: ~3×period