Skip to content
All library documents

ATR Percentile Regimes for Volatility-Based Strategy Filters

Article MQL5 code base

Summary

This indicator classifies volatility as compression, normal, or expansion by ranking current ATR against its recent history. Unlike a fixed ATR cutoff, a percentile rank adapts the classification to the symbol and timeframe. The stated defaults use a 14-period ATR, a 100-bar ranking window, and thresholds at the 20th and 80th percentiles. The chart shades compression and expansion bars, can optionally shade normal bars, and can show the current regime and percentile.

The document suggests using compression as a setup filter for breakout systems, expansion as a context for trend continuation and wider stops, and compression or normal conditions for mean-reversion entries. These are proposed applications, not tested findings. Expert Advisors can access the percentile and regime code through indicator buffers; the current forming bar can change with price, while alerts are based on closed bars. The document gives no performance evidence or guidance on choosing thresholds for a particular market.

Key ideas

  • Current ATR is ranked against a rolling history to assign a relative volatility regime.
  • Compression, normal, and expansion are represented by percentile thresholds and optional chart shading.
  • The regimes are proposed as context filters for breakout, trend-following, and mean-reversion systems.
  • Indicator buffers expose the percentile and regime, while alerts rely on closed bars.
  • The suggested strategy uses and default settings are not supported by performance tests.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.