ATR regime
Whether current volatility is low (0), medium (1) or high (2) against its recent average range.
Despite the name, this measures volatility only, not trend. Each bar gets its average true range (ATR), a Wilder-smoothed average of the bar's high-low range, widened to the prior close when the bar gaps, taken over atr_window bars. The indicator divides the current ATR by the mean of the last regime_window ATR values, the current one included. A ratio above 1.3 gives 2, above 0.8 gives 1, and anything lower gives 0.
How to read it
- The line sits in its own pane below the price and takes whole values: 0 low, 1 medium, 2 high.
- At defaults on SPY one-minute bars from September 2026 the median was 1, and the 5th and 95th percentiles were 0 and 2, so both extremes do occur.
- A 2 means the smoothed range is more than 1.3 times its recent average. A 0 means it fell under 0.8 times that average, a quieter stretch than the last 20 bars.
What it outputs
- Volatility regime
- 0 low, 1 medium or 2 high volatility: the current ATR against the mean of the last regime_window ATR values, the current one included. Blank until atr_window + regime_window - 2 bars.
Settings
- atr_window
- Bars in the smoothed true-range average (default 14). Raising it smooths ATR more, so the ratio stays nearer 1 and the reading sits at 1 more often. Lowering it follows each bar's range, so 0 and 2 come up more often.
- regime_window
- Bars in the baseline the current ATR is compared with (default 20). Raising it lets 0 and 2 come up more often. Lowering it keeps the reading near 1; at 1 the baseline is the current bar alone, so the reading is always 1.
Pitfalls
- The 1.3 and 0.8 cut-offs are fixed in the code, not parameters, so the two windows are the only tuning.
- The reading is relative to the recent baseline: a bar's ATR can read 2 while its range is still small, if the last 20 bars were quieter.
- If the baseline averages exactly zero, the code returns 1 (medium) instead of 0, so a fully flat stretch reads medium.