OPEN-SOURCE SCRIPT
BB Crosses Optimized - [JTCAPITAL]

BB Crosses Optimized is a modified way to use Bollinger Bands for Trend-Following
The indicator works by calculating in the following steps:
1. The source gets smoothed out using a moving average
2. Calculating the Bollinger Bands using the SMA of the smoothed source and the standard deviation of the smoothed source.
3. Trigger a signal based on current price and the buy/sell conditions.
--Buy and sell conditions--
-The buy and sell conditions are defined by the price going above/below the first standard deviation. When this goes on the opposite direction of the current trend, the trend changes. If this goes in the same direction of the current trend, the line follows the price by moving up with the standard deviation.
-When using the ATR filter the ATR gets subtracted from the lows or added onto the highs to eliminate false signals in choppy markets.
--Features and Parameters--
-Allows the usage of different sources
-Allows the usage of different moving average types
-Allows the changing of the length of the ATR
-Allows the changing of the length of the bollinger bands period
-Allows the changing of the standard deviation used from the bollinger bands
-Allows the changing of the length for smoothing out the price data
--Details--
This script is using multiple moving averages, sometimes even stacked upon eachother. And it also uses the moving average of the raw data on a short period to calculate the standard deviations. This in combination with the ATR filter is meant to eliminate as much false signals as I could. Without making all the entries and exits extremely delayed.
Be aware that disabling the ATR will allow for faster entries and exits but also allow for more false signals. It is recommended to change the parameters to fit your liking and to adjust to the timeframe you are working on.
Enjoy!
The indicator works by calculating in the following steps:
1. The source gets smoothed out using a moving average
2. Calculating the Bollinger Bands using the SMA of the smoothed source and the standard deviation of the smoothed source.
3. Trigger a signal based on current price and the buy/sell conditions.
--Buy and sell conditions--
-The buy and sell conditions are defined by the price going above/below the first standard deviation. When this goes on the opposite direction of the current trend, the trend changes. If this goes in the same direction of the current trend, the line follows the price by moving up with the standard deviation.
-When using the ATR filter the ATR gets subtracted from the lows or added onto the highs to eliminate false signals in choppy markets.
--Features and Parameters--
-Allows the usage of different sources
-Allows the usage of different moving average types
-Allows the changing of the length of the ATR
-Allows the changing of the length of the bollinger bands period
-Allows the changing of the standard deviation used from the bollinger bands
-Allows the changing of the length for smoothing out the price data
--Details--
This script is using multiple moving averages, sometimes even stacked upon eachother. And it also uses the moving average of the raw data on a short period to calculate the standard deviations. This in combination with the ATR filter is meant to eliminate as much false signals as I could. Without making all the entries and exits extremely delayed.
Be aware that disabling the ATR will allow for faster entries and exits but also allow for more false signals. It is recommended to change the parameters to fit your liking and to adjust to the timeframe you are working on.
Enjoy!
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.