OPEN-SOURCE SCRIPT
Adaptive 2-Pole Trend Bands [supfabio]

Adaptive 2-Pole Trend Bands is a volatility-aware trend filtering indicator designed to identify the dominant market direction while providing dynamic reference zones around price.
Instead of relying on traditional moving averages, this indicator uses a two-pole digital filter to smooth price action while maintaining responsiveness. Around this central trend line, a multi-band structure based on ATR is applied to help traders evaluate pullbacks, extensions, and potential exhaustion areas within a trend.
Core Concept
The indicator is built around three key ideas:
Digital Trend Filtering
Volatility-Adjusted Bands
Trend Persistence Measurement
These components work together to separate meaningful price movement from noise and to provide context for how far price has moved relative to recent volatility.
Two-Pole Trend Filter
At its core, the indicator uses a two-pole smoothing filter, which produces a cleaner trend curve than common moving averages.
Compared to standard averages, this approach:
Reduces market noise
Produces smoother transitions
Responds faster to genuine trend changes
Avoids excessive lag in trending markets
The result is a trend line that represents the structural direction of price, rather than short-term fluctuations.
Adaptive Multi-Band System
Around the central trend filter, the indicator plots four independent volatility-based bands, each derived from the Average True Range (ATR).
Each band represents a different degree of price extension:
Band 1: Shallow pullbacks and minor reactions
Band 2: Moderate extensions within a trend
Band 3: Strong directional moves
Band 4: Extreme extensions relative to recent volatility
Because the bands are ATR-based, they automatically adapt to changing market conditions, expanding during high volatility and contracting during calmer periods.
This makes the indicator suitable for both slow and fast markets without manual recalibration.
Trend State Detection
The color of the central filter dynamically reflects trend persistence, not just direction:
Sustained upward movement highlights bullish conditions
Sustained downward movement highlights bearish conditions
Transitional phases are visually distinct, helping identify regime changes
This logic is based on how long price has maintained directional behavior, reducing sensitivity to isolated candles or short-lived spikes.
Practical Applications
This indicator can be used as:
A trend filter for discretionary or systematic strategies
A context tool to evaluate pullbacks versus overextension
A risk reference to avoid entries in extreme price zones
A confirmation layer when combined with price action or momentum tools
It performs consistently across different asset classes, including futures, cryptocurrencies, forex, indices, and equities.
Configuration
Key parameters such as filter length, damping factor, and band multipliers are fully configurable, allowing traders to adapt the indicator to different timeframes and trading styles.
Important Notes
This indicator does not predict future price movement
It does not generate guaranteed buy or sell signals
Best results are achieved when used in combination with sound risk management and additional confirmation tools
Past behavior does not imply future performance
Disclaimer
This indicator is provided for educational and analytical purposes only and should not be considered financial advice.
Se quiser, posso:
Criar uma versão resumida para a primeira linha da publicação
Ajustar o texto para um tom mais técnico ou mais comercial
Traduzir para português mantendo o inglês como idioma principal
Revisar o título para SEO dentro da Biblioteca Pública
Instead of relying on traditional moving averages, this indicator uses a two-pole digital filter to smooth price action while maintaining responsiveness. Around this central trend line, a multi-band structure based on ATR is applied to help traders evaluate pullbacks, extensions, and potential exhaustion areas within a trend.
Core Concept
The indicator is built around three key ideas:
Digital Trend Filtering
Volatility-Adjusted Bands
Trend Persistence Measurement
These components work together to separate meaningful price movement from noise and to provide context for how far price has moved relative to recent volatility.
Two-Pole Trend Filter
At its core, the indicator uses a two-pole smoothing filter, which produces a cleaner trend curve than common moving averages.
Compared to standard averages, this approach:
Reduces market noise
Produces smoother transitions
Responds faster to genuine trend changes
Avoids excessive lag in trending markets
The result is a trend line that represents the structural direction of price, rather than short-term fluctuations.
Adaptive Multi-Band System
Around the central trend filter, the indicator plots four independent volatility-based bands, each derived from the Average True Range (ATR).
Each band represents a different degree of price extension:
Band 1: Shallow pullbacks and minor reactions
Band 2: Moderate extensions within a trend
Band 3: Strong directional moves
Band 4: Extreme extensions relative to recent volatility
Because the bands are ATR-based, they automatically adapt to changing market conditions, expanding during high volatility and contracting during calmer periods.
This makes the indicator suitable for both slow and fast markets without manual recalibration.
Trend State Detection
The color of the central filter dynamically reflects trend persistence, not just direction:
Sustained upward movement highlights bullish conditions
Sustained downward movement highlights bearish conditions
Transitional phases are visually distinct, helping identify regime changes
This logic is based on how long price has maintained directional behavior, reducing sensitivity to isolated candles or short-lived spikes.
Practical Applications
This indicator can be used as:
A trend filter for discretionary or systematic strategies
A context tool to evaluate pullbacks versus overextension
A risk reference to avoid entries in extreme price zones
A confirmation layer when combined with price action or momentum tools
It performs consistently across different asset classes, including futures, cryptocurrencies, forex, indices, and equities.
Configuration
Key parameters such as filter length, damping factor, and band multipliers are fully configurable, allowing traders to adapt the indicator to different timeframes and trading styles.
Important Notes
This indicator does not predict future price movement
It does not generate guaranteed buy or sell signals
Best results are achieved when used in combination with sound risk management and additional confirmation tools
Past behavior does not imply future performance
Disclaimer
This indicator is provided for educational and analytical purposes only and should not be considered financial advice.
Se quiser, posso:
Criar uma versão resumida para a primeira linha da publicação
Ajustar o texto para um tom mais técnico ou mais comercial
Traduzir para português mantendo o inglês como idioma principal
Revisar o título para SEO dentro da Biblioteca Pública
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.