OPEN-SOURCE SCRIPT
20 MA with ATR

This indicator overlays a Moving Average (SMA or EMA) on the chart, along with dynamic upper and lower bands based on the Average True Range (ATR). It's designed to help you track long-term trend direction and volatility zones with clarity — ideal for monthly or higher timeframe analysis.
What It Does ?
Plots a Simple or Exponential Moving Average (MA) of a chosen price (default is Low).
Adds two dynamic bands:
Upper Band = MA + ATR
Lower Band = MA - ATR
Uses ATR (Average True Range) to represent market volatility and distance from the moving average.
Why Use This?
This indicator blends trend and volatility awareness into a single view:
Use the MA as a long-term trend guide.
Use the ATR bands to identify:
Potential buy zones near lower band during uptrends.
Caution zones near upper band where price may be extended.
On monthly charts, this helps long-term investors spot deep-value or extended price levels based on both trend and volatility.
Customizable Inputs
MA Type: SMA or EMA
MA Length: Default is 20 periods (great for monthly swing cycles)
ATR Length: Default is 14 (standard volatility window)
Input Source: Use Low, Close, or any price point for flexibility
Suggested Use (Monthly Charts)
Track when price pulls back toward the lower ATR band for potential accumulation zones.
Monitor breakouts above the upper ATR band as signs of momentum continuation.
Spot trend exhaustion when price hugs an ATR band for too long.
Ideal For:
Long-term investors and swing traders
Value buyers looking for low-risk re-entries in trends
Portfolio positioning during market extremes
What It Does ?
Plots a Simple or Exponential Moving Average (MA) of a chosen price (default is Low).
Adds two dynamic bands:
Upper Band = MA + ATR
Lower Band = MA - ATR
Uses ATR (Average True Range) to represent market volatility and distance from the moving average.
Why Use This?
This indicator blends trend and volatility awareness into a single view:
Use the MA as a long-term trend guide.
Use the ATR bands to identify:
Potential buy zones near lower band during uptrends.
Caution zones near upper band where price may be extended.
On monthly charts, this helps long-term investors spot deep-value or extended price levels based on both trend and volatility.
Customizable Inputs
MA Type: SMA or EMA
MA Length: Default is 20 periods (great for monthly swing cycles)
ATR Length: Default is 14 (standard volatility window)
Input Source: Use Low, Close, or any price point for flexibility
Suggested Use (Monthly Charts)
Track when price pulls back toward the lower ATR band for potential accumulation zones.
Monitor breakouts above the upper ATR band as signs of momentum continuation.
Spot trend exhaustion when price hugs an ATR band for too long.
Ideal For:
Long-term investors and swing traders
Value buyers looking for low-risk re-entries in trends
Portfolio positioning during market extremes
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.