Skip to content

Free MT5 indicator

ATR Volatility Regime

ATR percentile rank for MT5 that colours each bar as a low, normal or high volatility regime, with alerts when the regime changes.

Volatilityv1.0MetaTrader 5 (MQL5) Compiles with 0 errors Non-repainting signals Alerts

What it does

ATR on its own is an absolute number, so it is hard to tell whether 15 pips of ATR is a lot or a little for a given market. This indicator answers that by ranking the current ATR against its own recent history. The result is a 0 to 100 percentile shown as a histogram: blue for a low volatility regime, grey for normal and orange-red for high.

How it works

  • True range = the largest of: high - low, |high - previous close|, |low - previous close|.
  • ATR = previous ATR + (true range - previous ATR) / ATR period (Wilder smoothing).
  • Percentile rank = 100 x (number of the previous L ATR values that are lower than the current ATR) / L, where L is the lookback.
  • Regime: low when the rank is below the low level, high when above the high level, normal otherwise.
  • An alert is sent once per bar when the last closed bar's regime differs from the bar before it.

For example (illustrative), with a lookback of 100, a rank of 85 means the current ATR is higher than 85 of the previous 100 ATR readings.

How to use it

Volatility regime is a filter that can make other tools more selective:

  • Low regime: ranges are compressed. Breakout traders often watch these periods because expansion tends to follow, while mean-reversion approaches can work inside the range.
  • High regime: bars are large and fast. Stops need more room, so position size usually has to come down to keep the same risk. The Position Size Calculator helps with that.
  • Normal regime: standard conditions for most strategies.

Because the rank is relative, it works the same way on forex pairs, gold, indices or crypto, and on any timeframe. Read the volatility lesson and the glossary entry on volatility for background.

Settings

InputDefaultWhat it changes
ATR period14Smoothness of the ATR being ranked
Percentile lookback100Longer lookbacks compare against a longer history
Low regime level20Threshold for blue bars
High regime level80Threshold for orange-red bars
Popup alert / Push notificationfalseAlerts once per bar on a regime change

Limitations

  • A percentile only says how volatility compares with the recent past; it does not predict direction or the size of the next move.
  • After a long quiet period even modest volatility can rank as high.
  • ATR lags, so regime changes appear after the volatility shift has begun.
  • The first ATR period x 2 + lookback bars have no reading while the calculation warms up.

Key inputs

Key inputs of ATR Volatility Regime
InputDefaultDescription
ATR period14Bars used for the Wilder-smoothed Average True Range.
Percentile lookback (bars)100Number of earlier ATR values the current ATR is ranked against.
Low regime below this percentile20Percentile under which bars are coloured as low volatility.
High regime above this percentile80Percentile over which bars are coloured as high volatility.
Popup alert on a regime changefalseShows an MT5 alert once per bar when a closed bar enters a new regime.

Educational tools, not advice. Indicators and Expert Advisors describe price; they do not predict it, and past behaviour does not guarantee future results. Test everything on a demo account first and never risk money you cannot afford to lose. See our disclaimer.

Keep exploring

Related mt5 indicators