Tags:

The Double Bollinger Bands Breakout strategy is a trend following strategy. It uses the upper and lower bands of Bollinger Bands to judge price trends and establish long positions when prices break through the inner Bollinger Bands and close positions when prices fall below the outer Bollinger Bands.

The strategy first calculates the moving average and standard deviation over a specified period. It then constructs the double Bollinger Bands using the moving average ± one standard deviation for the inner bands and the moving average ± 1.5 standard deviations for the outer bands.

When prices break above the upper inner band, it indicates that the market is starting a bull run so goes long. When prices fall below the lower inner band, it indicates the start of a bear market so goes short.

The profit taking exit for long positions is when prices fall below the lower outer band. The profit taking exit for short positions is when prices break above the upper outer band.

The strategy also sets stop loss, take profit and trailing stop loss exits.

The Double Bollinger Bands Breakout strategy has the following advantages:

- Using double Bollinger Bands to judge price moves allows effective trend following;
- Entering on inner band breakouts avoids unnecessary mean reversion trades;
- Take profit, stop loss and trailing stop losses effectively control risk;
- Optimizable parameters allow tuning for different products.

The Double Bollinger Bands Breakout strategy also has some risks:

- Frequent entries and stop losses may occur during ranging markets;
- Improper parameter settings could lead to too easy entries or difficult exits;
- Breakouts sometimes give false signals resulting in failed breakouts.

To address these risks, parameters could be adjusted, additional filters added, or breakouts manually monitored to reduce risk.

The Double Bollinger Bands Breakout strategy can be optimized in several ways:

- Optimize moving average and standard deviation parameters to fit different products;
- Add volume, MACD or other filters to avoid false breakouts;
- Use machine learning methods to dynamically optimize parameters;
- Copy strategy across multiple high frequency intervals to expand profit potential.

The Double Bollinger Bands Breakout strategy overall judges changes in price relative to Bollinger Bands to time entries in a typical trend following approach. The strategy sets profit targets using the double bands and scientific exit mechanisms to control risk. With optimized parameters and risk controls, it can achieve good results.

/*backtest start: 2023-12-17 00:00:00 end: 2023-12-24 00:00:00 period: 15m basePeriod: 5m exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=2 strategy("BB Strat",default_qty_type = strategy.percent_of_equity, default_qty_value = 100,currency="USD",initial_capital=100, overlay=true) l=input(title="length",defval=100) pbin=input(type=float,step=.1,defval=.25) pbout=input(type=float,step=.1,defval=1.5) ma=sma(close,l) sin=stdev(ma,l)*pbin sout=stdev(ma,l)*pbout inu=sin+ma inb=-sin+ma outu=sout+ma outb=-sout+ma plot(inu,color=lime) plot(inb,color=lime) plot(outu,color=red) plot(outb,color=yellow) inpTakeProfit = input(defval = 0, title = "Take Profit", minval = 0) inpStopLoss = input(defval = 0, title = "Stop Loss", minval = 0) inpTrailStop = input(defval = 0, title = "Trailing Stop Loss", minval = 0) inpTrailOffset = input(defval = 0, title = "Trailing Stop Loss Offset", minval = 0) useTakeProfit = inpTakeProfit >= 1 ? inpTakeProfit : na useStopLoss = inpStopLoss >= 1 ? inpStopLoss : na useTrailStop = inpTrailStop >= 1 ? inpTrailStop : na useTrailOffset = inpTrailOffset >= 1 ? inpTrailOffset : na longCondition = close>inu and rising(outu,1) exitlong = (open[1]>outu and close<outu) or crossunder(close,ma) shortCondition = close<inb and falling(outb,1) exitshort = (open[1]<outb and close>outb) or crossover(close,ma) strategy.entry(id = "Long", long=true, when = longCondition) strategy.close(id = "Long", when = exitlong) strategy.exit("Exit Long", from_entry = "Long", profit = useTakeProfit, loss = useStopLoss, trail_points = useTrailStop, trail_offset = useTrailOffset, when=exitlong) strategy.entry(id = "Short", long=false, when = shortCondition) strategy.close(id = "Short", when = exitshort) strategy.exit("Exit Short", from_entry = "Short", profit = useTakeProfit, loss = useStopLoss, trail_points = useTrailStop, trail_offset = useTrailOffset, when=exitshort)

- Low Lag Triple Moving Average Fast Trading Strategy
- Trend Following Strategy Based on Multi Timeframe TEMA Crossover
- Dynamic Balancing Strategy with 50% Funds and 50% Positions
- Single-Side Entry Strategy Based on Moving Average
- Adaptive Multi Timeframe Fibonacci Retracement Trading Strategy
- Oscillating Long-Short RSI Crypto Switching Strategy
- Trend Trading Strategy Based on Triple Hull Moving Averages and Ichimoku Kinko Hyo
- Dynamic Moving Averages and Keltner Channel Trading Strategy
- Trend Following Strategy Based on RSI and Weighted Moving Average
- Dual Moving Average Reversal Strategy
- Keltner Channel Tracking Strategy
- Price Volume Trend Strategy
- KST策略
- Three SMA Crossover Momentum Strategy
- Dual Reversal Momentum Index Trading Strategy
- Dual Bollinger Band Volatility Tracking Strategy
- MACD Histogram Strategy of RSI
- Quantitative Trading Strategy Based on RSI Indicator and Moving Average
- BBMA Breakthrough Strategy
- An Enhanced Flag Pattern Recognition Strategy Integrating with SuperTrend