OPEN-SOURCE SCRIPT
Updated Bollinger Bands Bull/Bear B2

Bollinger Bands Bull/Bear
by MasterTony
Overview & How It Works:
This indicator enhances classic Bollinger Bands by the legendary John Bollinger with emphasizing dynamic bull/bear coloring, gradient strength fills, overextension highlights, and an orange squeeze overlay to visualize volatility contraction.
Core Calculations:
Basis Line: User-selectable moving average (SMA by default) of the source (close by default).
Upper / Lower Bands: Basis ± (Multiplier × Standard Deviation over the chosen length). Default multiplier = 2.0.
Bull / Bear State Determination: Price position relative to the basis and outer or lower bollinger bands, smoothed with a short EMA.
Hysteresis is applied to prevent rapid flipping during consolidation.
Result: stable bullish state when price is convincingly above the basis, bearish when below.
Proximity & Gradient Strength: Distance from price to each band is measured and normalized against current band width.
The closer price is to a band, the stronger the signal and the more opaque the fill becomes.
Colored Band Fills: Bullish state → mint-green fills around both bands (brighter/opaquer when price hugs the upper band).
Bearish state → red fills around both bands (brighter/opaquer when price hugs the lower band).
Special Overextension Fill:
When price is very close (>85%) to the "active" band (upper in bull, lower in bear) and the state is confirmed, a Brighter gradient of the band green (bull) or lred (bear).
Strong Vs Weak Bollinger
Thicker the Bollinger Band stronger the trend, thinner the weaker. Gradient going from brighter to more transparent highlights potential exhaustion of strong Bollinger.
Squeeze Detection (Orange Overlay):
Bollinger Band Width Percentile (BBWP) is calculated over a user-defined lookback (default 100 bars).
Squeeze = BBWP ≤ 25% (bands are historically narrow).
Tight squeeze = BBWP < 15% → brighter orange.
Orange fill covers the entire area between upper and lower bands during squeeze periods.
Toggle available to hide squeeze fills if desired.
How to Read & Trade This Indicator
Visual Interpretation:
Green-dominant chart (mint fills + possible light-green basis-to-band fill) = bullish bias. The brighter and fuller the green, the stronger the momentum (price pushing against or touching the upper band).
Red-dominant chart (red fills + possible light-red basis-to-band fill) = bearish bias. Brighter/fuller red = stronger downward pressure.
Light special fills (light green or light red from basis to band) = overextension zone. Often seen near trend extremes — watch for continuation (breakout) or reversal (failure to hold the band).
Orange overlay = low volatility / squeeze. Two shades:
Lighter orange = regular squeeze (potential move brewing).
Brighter orange = very tight squeeze (high probability of imminent explosive move).
Trading Guidelines:
Trend Following (Shows Bull Zone and Bear Zones):
In green fills → favor longs or hold existing longs.
In red fills → favor shorts or hold existing shorts.
Strength increases as fills become more opaque (price near the outer band).
Squeeze Breakouts (Highest Probability Setups):
Wait for orange squeeze to appear.
When price closes outside the bands (breakout), enter in the direction of the break.
Bias the trade toward the prevailing color:Breakout upward during green fills = strong long signal.
Breakout downward during red fills = strong short signal.
If breakout direction opposes the color bias, be cautious (lower probability).
Entry/Exits:
Follow the Band color, Band color with special fill green or red is strong to determining Bull or Bear states. Green=price up Red= Price down
Risk Management:
Use the basis line as dynamic support/resistance.
Stops can be placed just beyond the opposite band or basis during strong trends.
Combine with volume or other confirmation for higher conviction.
This visual upgrade makes Bollinger Bands far more intuitive — the chart literally colors itself bullish or bearish while highlighting volatility cycles and overextension zones. Great for trend, breakout, and mean-reversion strategies across any timeframe.
Enjoy fellow traders, this is V1 more versions will be updated.
Please also boost and comment would love your ideas on advancements to this.
Cheers,
MasterTony
by MasterTony
Overview & How It Works:
This indicator enhances classic Bollinger Bands by the legendary John Bollinger with emphasizing dynamic bull/bear coloring, gradient strength fills, overextension highlights, and an orange squeeze overlay to visualize volatility contraction.
Core Calculations:
Basis Line: User-selectable moving average (SMA by default) of the source (close by default).
Upper / Lower Bands: Basis ± (Multiplier × Standard Deviation over the chosen length). Default multiplier = 2.0.
Bull / Bear State Determination: Price position relative to the basis and outer or lower bollinger bands, smoothed with a short EMA.
Hysteresis is applied to prevent rapid flipping during consolidation.
Result: stable bullish state when price is convincingly above the basis, bearish when below.
Proximity & Gradient Strength: Distance from price to each band is measured and normalized against current band width.
The closer price is to a band, the stronger the signal and the more opaque the fill becomes.
Colored Band Fills: Bullish state → mint-green fills around both bands (brighter/opaquer when price hugs the upper band).
Bearish state → red fills around both bands (brighter/opaquer when price hugs the lower band).
Special Overextension Fill:
When price is very close (>85%) to the "active" band (upper in bull, lower in bear) and the state is confirmed, a Brighter gradient of the band green (bull) or lred (bear).
Strong Vs Weak Bollinger
Thicker the Bollinger Band stronger the trend, thinner the weaker. Gradient going from brighter to more transparent highlights potential exhaustion of strong Bollinger.
Squeeze Detection (Orange Overlay):
Bollinger Band Width Percentile (BBWP) is calculated over a user-defined lookback (default 100 bars).
Squeeze = BBWP ≤ 25% (bands are historically narrow).
Tight squeeze = BBWP < 15% → brighter orange.
Orange fill covers the entire area between upper and lower bands during squeeze periods.
Toggle available to hide squeeze fills if desired.
How to Read & Trade This Indicator
Visual Interpretation:
Green-dominant chart (mint fills + possible light-green basis-to-band fill) = bullish bias. The brighter and fuller the green, the stronger the momentum (price pushing against or touching the upper band).
Red-dominant chart (red fills + possible light-red basis-to-band fill) = bearish bias. Brighter/fuller red = stronger downward pressure.
Light special fills (light green or light red from basis to band) = overextension zone. Often seen near trend extremes — watch for continuation (breakout) or reversal (failure to hold the band).
Orange overlay = low volatility / squeeze. Two shades:
Lighter orange = regular squeeze (potential move brewing).
Brighter orange = very tight squeeze (high probability of imminent explosive move).
Trading Guidelines:
Trend Following (Shows Bull Zone and Bear Zones):
In green fills → favor longs or hold existing longs.
In red fills → favor shorts or hold existing shorts.
Strength increases as fills become more opaque (price near the outer band).
Squeeze Breakouts (Highest Probability Setups):
Wait for orange squeeze to appear.
When price closes outside the bands (breakout), enter in the direction of the break.
Bias the trade toward the prevailing color:Breakout upward during green fills = strong long signal.
Breakout downward during red fills = strong short signal.
If breakout direction opposes the color bias, be cautious (lower probability).
Entry/Exits:
Follow the Band color, Band color with special fill green or red is strong to determining Bull or Bear states. Green=price up Red= Price down
Risk Management:
Use the basis line as dynamic support/resistance.
Stops can be placed just beyond the opposite band or basis during strong trends.
Combine with volume or other confirmation for higher conviction.
This visual upgrade makes Bollinger Bands far more intuitive — the chart literally colors itself bullish or bearish while highlighting volatility cycles and overextension zones. Great for trend, breakout, and mean-reversion strategies across any timeframe.
Enjoy fellow traders, this is V1 more versions will be updated.
Please also boost and comment would love your ideas on advancements to this.
Cheers,
MasterTony
Release Notes
Ok new additions:Table added Performance rank column so you can see % move of historical trend to gauge extension of move how much room it can go to based on historical stats.
Volatility Heatmap
You will see dots with heatmap colors.. this is derived from BBWP (bollinger band width percentile) Blue is calm waters can lead to big move...overheated is red everything in between blue and red is volatile heat movement..... focus on blue for low volatility and when you see red move is likely overheated..... no direction bias strictly volatility Big move can happen either direction. But if you see red or green on Bollinger fill that gives you idea of probability
ANY OTHER IDEAS YOU SEE AS GOOD TO IMPLEMENT PLEASE LET ME KNOW WOULD LOVE TO KEEP ADVANCING TOGETHER!
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.