Fancy Bollinger Bands [BigBitsIO]

This script is for a Bollinger Band type indicator with as many features as I can possibly fit into a Bollinger Band type indicator.

- A single custom moving average serving as the middle band.

- Standard MA inputs.
- MA type.
- MA period.
- MA price.
- MA resolution (time frame).
- Visibility toggle.
- MA Candle Type

- Fancy MA inputs.
- Toggle to show only candles included in the MA calculation ("Highlight inclusion") or display entire MA history.
- Toggle to show a ghost trail when Highlight inclusion is toggled on. Displays a shaded version of past MA history before the inclusion period (as seen on snapshot).
- Toggle to show forecast values for the MA.
- Other inputs related to forecasting:
- Forecast bias. (Neutral forecasts MA if the current price remains the same.)
- Forecast period.
- Forecast magnitude.
- Toggle showing details on the screen
- Toggle the visibility of the fill between the upper and lower bands.
- Toggle to use ATR instead of the standard deviation to calculate the location of the upper and lower bands.
- Custom input for the ATR period.

A couple of quick notes. The label will only show up if toggled on, and will always show above the highest of either the candle high or upper band. The fill colors are based on the level of %B currently on the indicator. Higher levels are green, and brighter green, while lower levels are red and brighter red. The fill is lighter in shadow areas to reflect their status as not being included in the middle band calculation.

*** DISCLAIMER: For educational and entertainment purposes only. Nothing in this content should be interpreted as financial advice or a recommendation to buy or sell any sort of security or investment including all types of crypto. DYOR, TYOB. ***
Release Notes: Update:

-Changed resolution input to the built-in input type. Note: to get custom resolutions added to the available dropdown you would need to switch back to the old method.
-Added separate deviation multipliers for the upper and lower bands.
-Added an option for a basic fill, for those who don't care for the %B based gradient.
-Added the ability to smooth out the upper and lower band individually with a custom selection of Moving Averages.
-Added several alert conditions in relation to price crossing over or under the respective bands.
Release Notes: Minor change in the title of the new resolution input.
Release Notes: Update: Had to "undo" the change to using the built-in resolution input as this broke forecasting for some reason.
Release Notes: Added ALMA, improved function code.
Remove from Favorite Scripts Add to Favorite Scripts
Like and follow!

💻 Website:
📺 YouTube:
🎮 Discord:
🐦 Twitter:
💸 Save $30 on TradingView Paid Plan:


Great job! I found this indicator more useful when combining BB of two timeframes into one chart, for example, adding both 5min BB and 15min BB into 5min chart.
I also observed that the 3 stdev of 15 min BB often act as a powerful support/resistance in 5 min chart.
+2 Reply
rz2ervtxhw nkcming
@nkcming, How do you add same two indicators of different timeframes onto one chart ?
BigBitsIO rz2ervtxhw
@rz2ervtxhw, Use the security function in Pine and specify the correct resolution. The best resource is the Pine Script Reference manual.
Holy moly a lot of code!

Thanks for sharing bro!

So much I can learn from you!
+1 Reply
lordram Confucius-The-Great
@Confucius-The-Great, A large amount of cascading IFs and CASE/SWITCH logic at first glance. Impressive nevertheless.
This publication will be featured in our "Best Scripts of The Month" selection. Thank you for your valuable contribution to the TradingView community, and congrats!
+1 Reply
What a magical deluxe version of BB!
Hi author, may I know what is the "forecast" about? I can't recognize the difference when I switch it on and off.
BigBitsIO BillionaireLau
@BillionaireLau, Forecasting shows the white dots to the right of the mid band. It uses a method to anticipate, thus forecast future values. When it is disabled, it should not show the white dots. If it is still showing it, that may be a bug and I will look to fix that.

I try to turn the background to be black.
I think you should talking about the area "ahead" the current bar? I can't see any drawing ahead the indicator.. lol
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Referred friends Coins My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out