OPEN-SOURCE SCRIPT
ATR Expansion

Introduction
ATR Expansion is a volatility analysis indicator that measures whether the current Average True Range (ATR) is expanding or contracting relative to its recent historical average.
Rather than displaying ATR alone, the indicator compares the current ATR with a longer-term baseline, helping traders identify periods of increasing or decreasing market volatility.
The result is presented as a zero-centered histogram, making changes in volatility easy to recognize.
How It Works
The indicator first calculates the Average True Range (ATR) using the selected ATR Length.
It then calculates a Simple Moving Average of the ATR to establish a volatility baseline.
The calculation is:
ATR Expansion = ((Current ATR − ATR Baseline) ÷ ATR Baseline) × 100
Positive values indicate current volatility is above its recent average.
Negative values indicate volatility is below its recent average.
Key Features
Volatility Monitoring
Instantly shows whether market volatility is expanding or contracting.
Relative Measurement
Instead of relying on raw ATR values, the indicator compares ATR against its own historical average.
Zero-Centered Histogram
The zero line clearly separates above-average volatility from below-average volatility.
Lightweight Design
Only requires standard ATR and SMA calculations, making it efficient for every market and timeframe.
Interpretation
Above Zero
Current ATR is higher than its historical average.
This indicates increasing market volatility.
Below Zero
Current ATR is lower than its historical average.
This suggests quieter market conditions.
Expanding Histogram
A rising histogram indicates volatility is accelerating.
Large directional price moves often occur during these periods.
Contracting Histogram
A falling histogram indicates volatility is decreasing.
Markets may be entering consolidation or reduced trading activity.
Alert Conditions
The indicator includes two built-in alerts.
ATR Expansion Increasing
Triggered when ATR moves above its historical average.
ATR Expansion Decreasing
Triggered when ATR falls below its historical average.
Example Applications
- Identifying volatility expansion.
- Detecting volatility contraction.
- Confirming breakout conditions.
- Monitoring changing market activity.
- Comparing volatility across multiple markets.
Notes
ATR Expansion measures volatility only.
It does not indicate whether the market is bullish or bearish.
High volatility can occur during both strong rallies and sharp declines.
For best results, combine ATR Expansion with trend analysis and price action to determine both direction and market activity.
ATR Expansion provides a simple way to monitor changing market volatility by comparing today's ATR with its recent historical average, helping traders recognize when markets become more active or more quiet.
ATR Expansion is a volatility analysis indicator that measures whether the current Average True Range (ATR) is expanding or contracting relative to its recent historical average.
Rather than displaying ATR alone, the indicator compares the current ATR with a longer-term baseline, helping traders identify periods of increasing or decreasing market volatility.
The result is presented as a zero-centered histogram, making changes in volatility easy to recognize.
How It Works
The indicator first calculates the Average True Range (ATR) using the selected ATR Length.
It then calculates a Simple Moving Average of the ATR to establish a volatility baseline.
The calculation is:
ATR Expansion = ((Current ATR − ATR Baseline) ÷ ATR Baseline) × 100
Positive values indicate current volatility is above its recent average.
Negative values indicate volatility is below its recent average.
Key Features
Volatility Monitoring
Instantly shows whether market volatility is expanding or contracting.
Relative Measurement
Instead of relying on raw ATR values, the indicator compares ATR against its own historical average.
Zero-Centered Histogram
The zero line clearly separates above-average volatility from below-average volatility.
Lightweight Design
Only requires standard ATR and SMA calculations, making it efficient for every market and timeframe.
Interpretation
Above Zero
Current ATR is higher than its historical average.
This indicates increasing market volatility.
Below Zero
Current ATR is lower than its historical average.
This suggests quieter market conditions.
Expanding Histogram
A rising histogram indicates volatility is accelerating.
Large directional price moves often occur during these periods.
Contracting Histogram
A falling histogram indicates volatility is decreasing.
Markets may be entering consolidation or reduced trading activity.
Alert Conditions
The indicator includes two built-in alerts.
ATR Expansion Increasing
Triggered when ATR moves above its historical average.
ATR Expansion Decreasing
Triggered when ATR falls below its historical average.
Example Applications
- Identifying volatility expansion.
- Detecting volatility contraction.
- Confirming breakout conditions.
- Monitoring changing market activity.
- Comparing volatility across multiple markets.
Notes
ATR Expansion measures volatility only.
It does not indicate whether the market is bullish or bearish.
High volatility can occur during both strong rallies and sharp declines.
For best results, combine ATR Expansion with trend analysis and price action to determine both direction and market activity.
ATR Expansion provides a simple way to monitor changing market volatility by comparing today's ATR with its recent historical average, helping traders recognize when markets become more active or more quiet.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.