ML-augmented ATR forecasts with outlier guards
Average True Range is the standard volatility input for stops and position sizing. The AnalyticsFX ATR prediction chart adds an ML forecast and a median-based outlier cap that keeps the axis readable.
ATR (Average True Range) is the workhorse volatility number in active trading. It sets stops, sizes positions, calibrates trailing exits, and feeds most volatility-aware strategies. The AnalyticsFX ATR prediction chart adds two things on top: a short-horizon ML forecast and a guard that prevents bad forecast values from blowing out the chart.
How the forecast works
The model is trained per-symbol on historical true-range series and recent realized volatility. It outputs a forecast line for the next N bars at the current bar's resolution. The forecast is a volatility prediction, not a directional one. It answers "how wide will the next few bars be," not "which way will price go."
The outlier guard
ML models on noisy financial data occasionally produce extreme values. Without protection, a single 2000% prediction spike can blow out the y-axis and make every other value unreadable. The AnalyticsFX prediction line uses a combined-median outlier cap: spikes beyond the cap are nulled out rather than plotted, so the line breaks visually rather than dragging the axis with it.
The same cap is applied to the actual TR series so the two are always comparable on the same scale.
What the chart shows
Three series sit on the same axis:
- TR Prediction (amber line). The model's forecast bar by bar.
- Actual TR (blue dashed line). The realized true range.
- Prediction Range (filled area). The shaded area between forecast and actual, skipped on bars where either side hit the outlier cap.
If the shaded fill is narrow and consistent, the model is tracking the symbol well. If it widens, the regime has changed and you should treat the forecast as advisory rather than load-bearing.
How to use the forecast
Two ways:
- Stop sizing. Use the forecast value, not the rolling average, to size stops during regime transitions. The forecast leads the rolling average by exactly the kind of margin that matters in a fast move.
- Strategy gating. If your strategy depends on a minimum expected range to be profitable, gate entries on the forecast crossing that threshold.
