OPEN-SOURCE SCRIPT
Adaptive ATR Trend Bands

Adaptive ATR Trend Bands is a volatility-based trend-state indicator built around a selectable moving average basis and ATR-derived upper/lower bands.
The script creates a dynamic channel around the selected basis type: EMA, SMA, or VWMA. Band width is calculated from ATR length and ATR multiplier settings. The area between the bands changes color according to the current trend state, making it easier to read whether price is operating in bullish or bearish conditions.
Trend shifts are detected when price breaks above the previous upper band from a bearish state or breaks below the previous lower band from a bullish state. When a bullish shift is confirmed, the script can print a LONG label. When a bearish shift is confirmed, the script can print a SHORT label.
Main features:
• ATR-based upper and lower volatility bands;
• Selectable basis type: EMA, SMA, or VWMA;
• Optional basis line with direction-based coloring;
• Trend-state fill between the bands;
• Bullish and bearish trend shift labels;
• Minimum bar distance between repeated labels;
• Optional bar-close confirmation;
• Adaptive basis slope filter;
• Adaptive ATR expansion filter;
• Optional multi-timeframe RSI filter;
• Optional higher-timeframe EMA trend filter;
• Alert conditions for bullish and bearish trend shifts.
The adaptive slope filter checks whether the basis line has enough directional movement relative to current ATR conditions. This helps reduce labels when the basis is too flat and price movement is less directional.
The adaptive ATR expansion filter compares current ATR with its own average for the active chart timeframe. This helps reduce labels during lower-volatility conditions where band breaks may be less meaningful.
The optional multi-timeframe RSI filter uses the previous completed RSI value from the selected higher timeframe. Bullish shifts are allowed when the higher-timeframe RSI is in the lower zone, while bearish shifts are allowed when the higher-timeframe RSI is in the upper zone.
The optional higher-timeframe EMA filter uses the previous completed higher-timeframe close and EMA value. Bullish shifts are allowed when the higher-timeframe close is above the EMA. Bearish shifts are allowed when the higher-timeframe close is below the EMA.
Practical use:
The bands can be used to read volatility-based trend structure. A bullish label marks a confirmed shift from bearish to bullish conditions according to the band break and enabled filters. A bearish label marks a confirmed shift from bullish to bearish conditions according to the band break and enabled filters.
This script is intended for chart analysis and educational use.
The script creates a dynamic channel around the selected basis type: EMA, SMA, or VWMA. Band width is calculated from ATR length and ATR multiplier settings. The area between the bands changes color according to the current trend state, making it easier to read whether price is operating in bullish or bearish conditions.
Trend shifts are detected when price breaks above the previous upper band from a bearish state or breaks below the previous lower band from a bullish state. When a bullish shift is confirmed, the script can print a LONG label. When a bearish shift is confirmed, the script can print a SHORT label.
Main features:
• ATR-based upper and lower volatility bands;
• Selectable basis type: EMA, SMA, or VWMA;
• Optional basis line with direction-based coloring;
• Trend-state fill between the bands;
• Bullish and bearish trend shift labels;
• Minimum bar distance between repeated labels;
• Optional bar-close confirmation;
• Adaptive basis slope filter;
• Adaptive ATR expansion filter;
• Optional multi-timeframe RSI filter;
• Optional higher-timeframe EMA trend filter;
• Alert conditions for bullish and bearish trend shifts.
The adaptive slope filter checks whether the basis line has enough directional movement relative to current ATR conditions. This helps reduce labels when the basis is too flat and price movement is less directional.
The adaptive ATR expansion filter compares current ATR with its own average for the active chart timeframe. This helps reduce labels during lower-volatility conditions where band breaks may be less meaningful.
The optional multi-timeframe RSI filter uses the previous completed RSI value from the selected higher timeframe. Bullish shifts are allowed when the higher-timeframe RSI is in the lower zone, while bearish shifts are allowed when the higher-timeframe RSI is in the upper zone.
The optional higher-timeframe EMA filter uses the previous completed higher-timeframe close and EMA value. Bullish shifts are allowed when the higher-timeframe close is above the EMA. Bearish shifts are allowed when the higher-timeframe close is below the EMA.
Practical use:
The bands can be used to read volatility-based trend structure. A bullish label marks a confirmed shift from bearish to bullish conditions according to the band break and enabled filters. A bearish label marks a confirmed shift from bullish to bearish conditions according to the band break and enabled filters.
This script is intended for chart analysis and educational use.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
CT Community from Lithuania: cryptoimperija.com
All content provided by Crypto Imperija is for informational and educational purposes only. Past performance does not guarantee future results.
All content provided by Crypto Imperija is for informational and educational purposes only. Past performance does not guarantee future results.
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
CT Community from Lithuania: cryptoimperija.com
All content provided by Crypto Imperija is for informational and educational purposes only. Past performance does not guarantee future results.
All content provided by Crypto Imperija is for informational and educational purposes only. Past performance does not guarantee future results.
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。