Bollinger Bands Filter

Bollinger Bands is a classic indicator that uses a simple moving average of 20 periods, along with plots of upper and lower bands that are 2 standard deviations away from the basis line. These bands help visualize price volatility and trend based on where the price is, in relation to the bands.

Bollinger Bands filter plots a long signal when price closes above the upper band and plots a short signal when price closes below the lower band. It doesn't take into account any other parameters such as Volume / RSI / Fundamentals etc, so user must use discretion based on confirmations from another indicator or based on fundamentals.

The filter works great when the price closes above/below upper/lower bands with continuation on next bar. It is definitely useful to have this filter along with other indicators to get early glimpse of breach/fail of bands on candle close during BB squeeze or based on volatility .

This can be used on Heikin Ashi candles for spotting trends, but HA candles are not recommended for trade entries as they don't reflect true price of the asset.

This filter's default is 55 SMA and 1 standard deviation, but these can be changed from settings.

It is definitely worth reading the 22 rules of Bollinger Bands written by John Bollinger .



1. Alerts can be created for long and short signals using "Once per bar close".

2. The indicator doesn't repaint.

Catatan Pelepasan: Code updated
Catatan Pelepasan: Standard Deviation - Float values can be used (2.0 max). For example, for lower lookback length, standard deviation of 1.5, 1.618 etc. can be used to get stable trade entries. Similarly, for longer lookback, 0.236, 0.618, 0.886 etc. values can be used.
Skrip sumber terbuka

Dalam semangat TradingView yang sebenar, penulis skrip ini telah menerbitkannya dengan menggunakan sumber terbuka supaya pedagang-pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda dapat menggunakannya secara percuma tetapi penggunaan semula kod ini dalam penerbitan adalah dikawalselia oleh Peraturan Rumah. Anda boleh menyukai skrip ini untuk menggunakannya pada carta.

Ingin menggunakan skrip ini pada carta?
Get in touch with me if you would like access to my Premium scripts for a trial before deciding on lifetime access.

Free Scripts -


Thank you for your hard work on this, great indicator!
+1 Balas
TradeChartist NJdevil81
@NJdevil81, Thank you. Best wishes.
Really useful. I have managed to adapt this quite easily into what I wanted. I was even impressed with the ability to use floats for the standard deviation which the built-one doesn't. Nice work. Thanks.
+1 Balas
TradeChartist George_Gently
@George_Gently, Thank you. Using Fib numbers for lookback and Std dev results in interesting and better results compared to classic settings. Glad you are able to adapt this idea to suit your trading style. All the best.
good one can you transfer this to strategy
+1 Balas
@Kachalo, Here you go.

+2 Balas
Thanks for the great work.
I use it in my chart and I set the alert both for long and short signal. However, I found that there is no alert triggered for short signal. For the long signal happened, both long and short signal were triggered at the same time.

I check the code. Is it due to the error at line 83 ?

If so, can you fix it? Thank you.
+1 Balas
TradeChartist fatyen704
@fatyen704, Thanks for pointing the error. Fixed. Thanks for your support.
another beautiful work from tradechartis!
Thank you mate!
+1 Balas
TradeChartist Amore1212
@Amore1212, Thank you.
Laman Utama Penyaring Saham Penyaring Forex Penyaring Kripto Kalendar Ekonomi Mengenai Ciri-ciri Carta Harga Rujuk rakan Peraturan Dalaman Pusat Bantuan Laman web dan Penyelesaian Broker Widget Penyelesaian Pencartaan Perpustakaan Pencartaan yang Ringan Blog & Berita Twitter
Profil Tetapan Profil Akaun dan Pengebilan Kawan-kawan yang dirujuk Coin Tiket Sokongan Saya Pusat Bantuan Mesej Peribadi Sembang Daftar Keluar