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.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
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.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
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.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.