The Bollinger Band breakout strategy is a long-only momentum chasing strategy. It uses the upper and lower bands of Bollinger Bands to judge price momentum and goes long when price breaks out above the upper band and closes position when price breaks down the lower band or moving average.
The strategy first calculates N-day moving average as the baseline, then adds and subtracts K times standard deviation above and below the baseline to construct upper and lower bands, forming Bollinger Bands. When price breaks out above the upper band, it signals an upward breakout, which is a golden cross signal. The strategy will open long position on this signal. When price breaks down the lower band or moving average, it signals a downward reversal, which is a death cross signal. The strategy will close out positions on this signal.
Since the upper and lower bands of Bollinger Bands can dynamically contain most of the distribution of price data, they represent the reasonable fluctuation range of current market prices. When price breaks through this reasonable fluctuation range, it means something unusual is happening in the market and positions need to be adjusted accordingly. This is the basic logic of the strategy.
The strategy has the following advantages:
The strategy also has some risks:
To control these risks, we can incorporate trend indicators like MACD, or properly adjust parameters to narrow Bollinger Bands to reduce bad signals.
The strategy can also be optimized from the following aspects:
Through the above optimizations, we can further improve the stability of the strategy and reduce trading risks.
In summary, the Bollinger Band breakout strategy is a rather classic trend chasing strategy. It has clear logic and easy automation. But there are still some flaws, requiring further optimizations to adapt to complex changing market environments. If combined properly with other indicators and mechanisms, the results can be greatly improved.
/*backtest start: 2023-01-22 00:00:00 end: 2024-01-28 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © Senthaamizh //@version=4 strategy(title="Bollinger Band Breakout", shorttitle = "BB-BO", overlay=true) source = close length = input(20, minval=1, title = "Period") //Length of the Bollinger Band mult = input(1.5, minval=0.001, maxval=50, title = "Standard Deviation") // Use 1.5 SD for 20 period MA; Use 2 SD for 10 period MA exit = input(1, minval=1, maxval=2,title = "Exit Option") // Use Option 1 to exit using lower band; Use Option 2 to exit using moving average basis = sma(source, length) dev = mult * stdev(source, length) upper = basis + dev lower = basis - dev if (crossover(source, upper)) strategy.entry("Long", strategy.long, qty=1) if(exit==1) if (crossunder(source, lower)) strategy.close("Long") if(exit==2) //basis is good for N50 but lower is good for BN (High volatility) if (crossunder(source, basis)) strategy.close("Long") plot(basis, color=color.red,title= "SMA") p1 = plot(upper, color=color.blue,title= "UB") p2 = plot(lower, color=color.blue,title= "LB") fill(p1, p2)