OPEN-SOURCE SCRIPT
ATR with Configurable ATR SMA

ATR with Configurable ATR SMA
Overview
ATR with Configurable ATR SMA is a volatility analysis indicator that plots the Average True Range (ATR) together with a Simple Moving Average (SMA) of the ATR. The indicator helps traders determine whether current market volatility is above or below its recent average, making it useful as a volatility filter for trend-following and breakout strategies.
Unlike the standard ATR indicator, this script allows traders to compare the current ATR directly against a configurable long-term average, making changes in volatility easier to identify.
Features
• Configurable ATR Length (default: 14)
• Configurable ATR SMA Length (default: 75)
• Separate indicator pane for improved readability
• Plots both ATR and ATR SMA simultaneously
• Background turns green when ATR is above its moving average
• Background turns red when ATR is below its moving average
• Displays a table showing:
Inputs
ATR Length
Determines the period used to calculate the Average True Range.
Default: 14
Higher values smooth volatility.
Lower values react faster to changes.
ATR SMA Length
Determines the moving average period applied to the ATR.
Default:
75
This serves as the long-term volatility benchmark.
Interpretation
ATR Above ATR SMA
When the ATR rises above its moving average, market volatility is increasing.
This often indicates:
• Stronger trends
• Expansion in price movement
• Better breakout conditions
• Increased trading opportunities
ATR Below ATR SMA
When ATR falls below its moving average, volatility is contracting.
This often suggests:
• Sideways markets
• Consolidation
• Reduced price movement
• Increased likelihood of false breakouts
Common Uses
This indicator can be used as a volatility filter for:
• Trend-following systems
• Breakout strategies
• Swing trading
• Futures trading
• Intraday trading
• Position trading
Many traders avoid taking breakout trades while ATR remains below its long-term average because lower volatility environments can produce less decisive price movements.
Example Trading Filter
Instead of taking every trading signal:
Entry Conditions
✓ Price above trend filter
✓ Momentum confirmation
✓ ATR > ATR SMA
This helps eliminate trades during low-volatility market conditions.
Background Colors
Green Background
Current ATR is above its moving average.
Market volatility is expanding.
Red Background
Current ATR is below its moving average.
Market volatility is below average.
Notes
ATR measures volatility only.
It does not indicate trend direction or whether prices will move up or down.
For best results, combine ATR with other tools such as:
• Moving Averages
• Hull Moving Average (HMA)
• MACD
• ADX
• Relative Strength
• Price Action
Best Timeframes
The indicator works on all timeframes including:
• 1 Minute
• 5 Minute
• 15 Minute
• 1 Hour
• 4 Hour
• Daily
• Weekly
Markets
Suitable for:
• Stocks
• ETFs
• Futures
• Commodities
• Forex
• Cryptocurrency
Disclaimer
This indicator is designed as a volatility analysis tool and should not be used as a standalone buy or sell signal. Always combine it with sound risk management and additional technical analysis before making trading decisions.
Overview
ATR with Configurable ATR SMA is a volatility analysis indicator that plots the Average True Range (ATR) together with a Simple Moving Average (SMA) of the ATR. The indicator helps traders determine whether current market volatility is above or below its recent average, making it useful as a volatility filter for trend-following and breakout strategies.
Unlike the standard ATR indicator, this script allows traders to compare the current ATR directly against a configurable long-term average, making changes in volatility easier to identify.
Features
• Configurable ATR Length (default: 14)
• Configurable ATR SMA Length (default: 75)
• Separate indicator pane for improved readability
• Plots both ATR and ATR SMA simultaneously
• Background turns green when ATR is above its moving average
• Background turns red when ATR is below its moving average
• Displays a table showing:
- Current ATR value
- Whether ATR is above or below its moving average
Inputs
ATR Length
Determines the period used to calculate the Average True Range.
Default: 14
Higher values smooth volatility.
Lower values react faster to changes.
ATR SMA Length
Determines the moving average period applied to the ATR.
Default:
75
This serves as the long-term volatility benchmark.
Interpretation
ATR Above ATR SMA
When the ATR rises above its moving average, market volatility is increasing.
This often indicates:
• Stronger trends
• Expansion in price movement
• Better breakout conditions
• Increased trading opportunities
ATR Below ATR SMA
When ATR falls below its moving average, volatility is contracting.
This often suggests:
• Sideways markets
• Consolidation
• Reduced price movement
• Increased likelihood of false breakouts
Common Uses
This indicator can be used as a volatility filter for:
• Trend-following systems
• Breakout strategies
• Swing trading
• Futures trading
• Intraday trading
• Position trading
Many traders avoid taking breakout trades while ATR remains below its long-term average because lower volatility environments can produce less decisive price movements.
Example Trading Filter
Instead of taking every trading signal:
Entry Conditions
✓ Price above trend filter
✓ Momentum confirmation
✓ ATR > ATR SMA
This helps eliminate trades during low-volatility market conditions.
Background Colors
Green Background
Current ATR is above its moving average.
Market volatility is expanding.
Red Background
Current ATR is below its moving average.
Market volatility is below average.
Notes
ATR measures volatility only.
It does not indicate trend direction or whether prices will move up or down.
For best results, combine ATR with other tools such as:
• Moving Averages
• Hull Moving Average (HMA)
• MACD
• ADX
• Relative Strength
• Price Action
Best Timeframes
The indicator works on all timeframes including:
• 1 Minute
• 5 Minute
• 15 Minute
• 1 Hour
• 4 Hour
• Daily
• Weekly
Markets
Suitable for:
• Stocks
• ETFs
• Futures
• Commodities
• Forex
• Cryptocurrency
Disclaimer
This indicator is designed as a volatility analysis tool and should not be used as a standalone buy or sell signal. Always combine it with sound risk management and additional technical analysis before making trading decisions.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน