OPEN-SOURCE SCRIPT
Average True Range with MA

Key features
ATR calculation: true range (ta.tr(true)) is smoothed using a selectable method to produce the ATR.
ATR smoothing options: RMA, SMA, EMA, or WMA for the ATR calculation.
MA-on-ATR: a separate moving average computed on the ATR values with its own length and smoothing method.
Display controls: toggles to show/hide the ATR and the ATR MA independently.
Appearance controls: separate color inputs for the ATR and the ATR MA, and a thicker line for the MA (linewidth=2).
Inputs
ATR Length (default 14): length used to smooth true range into the ATR.
ATR Smoothing (default RMA): smoothing method applied to the true range to form ATR.
MA Length (on ATR) (default 14): length for the moving average applied to the ATR series.
MA Smoothing (default SMA): smoothing method used for the MA applied to ATR.
Show ATR / Show ATR MA: booleans to toggle visibility.
ATR Color / ATR MA Color: choose plot colors.
How to interpret
ATR line: shows current volatility (average true range). Rising ATR indicates increasing volatility; falling ATR indicates decreasing volatility.
ATR MA line: smooths the ATR to reveal trend direction and reduce noise.
Use crossovers: ATR crossing above its MA may signal volatility is picking up; ATR crossing below its MA suggests volatility is subsiding.
Combine with price action or other indicators (e.g., breakout systems, position sizing rules) to make decisions based on volatility regime.
ATR calculation: true range (ta.tr(true)) is smoothed using a selectable method to produce the ATR.
ATR smoothing options: RMA, SMA, EMA, or WMA for the ATR calculation.
MA-on-ATR: a separate moving average computed on the ATR values with its own length and smoothing method.
Display controls: toggles to show/hide the ATR and the ATR MA independently.
Appearance controls: separate color inputs for the ATR and the ATR MA, and a thicker line for the MA (linewidth=2).
Inputs
ATR Length (default 14): length used to smooth true range into the ATR.
ATR Smoothing (default RMA): smoothing method applied to the true range to form ATR.
MA Length (on ATR) (default 14): length for the moving average applied to the ATR series.
MA Smoothing (default SMA): smoothing method used for the MA applied to ATR.
Show ATR / Show ATR MA: booleans to toggle visibility.
ATR Color / ATR MA Color: choose plot colors.
How to interpret
ATR line: shows current volatility (average true range). Rising ATR indicates increasing volatility; falling ATR indicates decreasing volatility.
ATR MA line: smooths the ATR to reveal trend direction and reduce noise.
Use crossovers: ATR crossing above its MA may signal volatility is picking up; ATR crossing below its MA suggests volatility is subsiding.
Combine with price action or other indicators (e.g., breakout systems, position sizing rules) to make decisions based on volatility regime.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının yaratıcısı, 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 yaratıcısı, 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.