OPEN-SOURCE SCRIPT
Multi Timeframe Bollinger Bands Spectrum [Ata]

Multi-Timeframe Bollinger Bands Spectrum [Ata]
Technical Overview
This script integrates multi-timeframe volatility analysis with volume-derived order flow estimation. By combining Bollinger Bands (statistical deviation) with internal candle volume logic, the indicator qualifies price movements to differentiate between sustained trends, reversals, and exhaustion events.
The system is designed to provide a structural context for price action, visualizing market regimes through a dual-zone spectrum and filtering signals based on the interaction between price location and specific volume thresholds.
Core Logic & Calculation
1. Volume Decomposition Algorithm
Instead of using total volume, the script estimates Buying Pressure vs. Selling Pressure based on the close position relative to the candle's High/Low range:
- Buying Volume (vb): Increases as the close approaches the High.
- Selling Volume (vs): Increases as the close approaches the Low.
This logic allows the detection of directional flow even within standard volume bars.
2. Statistical Spectrum
The indicator renders deviations from the Basis (SMA) as two distinct zones:
- Bullish Zone (Blue): Price positioning between the Basis and Upper Band.
- Bearish Zone (Red): Price positioning between the Basis and Lower Band.
This structure is applied across multiple timeframes (overlay) to visualize the macro trend context without noise.
3. Non-Repainting Execution
To ensure historical accuracy and reliability for backtesting, all higher-timeframe data is requested using "lookahead_off". Signals are confirmed only upon the closure of the respective timeframe's candle.
Signal Definitions
Signals are generated only when specific Volatility and Volume conditions intersect:
Reversal Setups (Reaction to Liquidity)
- WALL: Triggered when price rejects the Upper Band accompanied by Extreme Selling Volume (vs > Limit). This suggests active limit sell orders absorbing the rally.
- FLOOR: Triggered when price rejects the Lower Band accompanied by Extreme Buying Volume (vb > Limit). This suggests active limit buy orders absorbing the drop.
- ABSORP: Identifies absorption near the lower bands where selling pressure is met with passive buying (indicated by lower wicks and relative buy volume).
Momentum Setups (Trend Continuation)
- POWER: Validates a breakout above the Upper Band only if supported by Dominant Buying Volume and a strong candle body.
- PANIC: Validates a breakdown below the Lower Band only if supported by Dominant Selling Volume.
- TRAP: Marks failed breakouts where price exits the bands but volume analysis contradicts the move (e.g., low directional volume).
Exhaustion Setups (Statistical Extremes)
- CLIMAX/CRASH: Identifies anomalies where price deviates significantly from the mean (Extreme Deviation) or when volume reaches unsustainable levels relative to the average, often preceding a mean reversion.
Input Parameters
- Bollinger Logic: Configuration for Length and Standard Deviation Multiplier.
- Volume Thresholds: Adjustable factors for Minimum Volume (Trend) and Extreme Volume (Reversal/Climax).
- Timeframe Layers: Toggle visibility for up to 5 higher timeframes.
- Theme: Adjusts label contrast for Dark/Light backgrounds.
Disclaimer
This indicator is strictly for analytical purposes. It provides a visualization of past market data based on statistical and volumetric formulas. Users should apply their own risk management protocols.
Technical Overview
This script integrates multi-timeframe volatility analysis with volume-derived order flow estimation. By combining Bollinger Bands (statistical deviation) with internal candle volume logic, the indicator qualifies price movements to differentiate between sustained trends, reversals, and exhaustion events.
The system is designed to provide a structural context for price action, visualizing market regimes through a dual-zone spectrum and filtering signals based on the interaction between price location and specific volume thresholds.
Core Logic & Calculation
1. Volume Decomposition Algorithm
Instead of using total volume, the script estimates Buying Pressure vs. Selling Pressure based on the close position relative to the candle's High/Low range:
- Buying Volume (vb): Increases as the close approaches the High.
- Selling Volume (vs): Increases as the close approaches the Low.
This logic allows the detection of directional flow even within standard volume bars.
2. Statistical Spectrum
The indicator renders deviations from the Basis (SMA) as two distinct zones:
- Bullish Zone (Blue): Price positioning between the Basis and Upper Band.
- Bearish Zone (Red): Price positioning between the Basis and Lower Band.
This structure is applied across multiple timeframes (overlay) to visualize the macro trend context without noise.
3. Non-Repainting Execution
To ensure historical accuracy and reliability for backtesting, all higher-timeframe data is requested using "lookahead_off". Signals are confirmed only upon the closure of the respective timeframe's candle.
Signal Definitions
Signals are generated only when specific Volatility and Volume conditions intersect:
Reversal Setups (Reaction to Liquidity)
- WALL: Triggered when price rejects the Upper Band accompanied by Extreme Selling Volume (vs > Limit). This suggests active limit sell orders absorbing the rally.
- FLOOR: Triggered when price rejects the Lower Band accompanied by Extreme Buying Volume (vb > Limit). This suggests active limit buy orders absorbing the drop.
- ABSORP: Identifies absorption near the lower bands where selling pressure is met with passive buying (indicated by lower wicks and relative buy volume).
Momentum Setups (Trend Continuation)
- POWER: Validates a breakout above the Upper Band only if supported by Dominant Buying Volume and a strong candle body.
- PANIC: Validates a breakdown below the Lower Band only if supported by Dominant Selling Volume.
- TRAP: Marks failed breakouts where price exits the bands but volume analysis contradicts the move (e.g., low directional volume).
Exhaustion Setups (Statistical Extremes)
- CLIMAX/CRASH: Identifies anomalies where price deviates significantly from the mean (Extreme Deviation) or when volume reaches unsustainable levels relative to the average, often preceding a mean reversion.
Input Parameters
- Bollinger Logic: Configuration for Length and Standard Deviation Multiplier.
- Volume Thresholds: Adjustable factors for Minimum Volume (Trend) and Extreme Volume (Reversal/Climax).
- Timeframe Layers: Toggle visibility for up to 5 higher timeframes.
- Theme: Adjusts label contrast for Dark/Light backgrounds.
Disclaimer
This indicator is strictly for analytical purposes. It provides a visualization of past market data based on statistical and volumetric formulas. Users should apply their own risk management protocols.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.