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.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.