Tags:

This strategy is based on the upper and lower rails of the Bollinger Bands to determine when the price breaks through the upper rail of the Bollinger Bands to go long and breaks through the lower rail to go short. It belongs to the trend tracking type of strategy.

This strategy uses the middle / upper / lower rail of the Bollinger Bands to determine extreme price ranges. The middle rail is the simple moving average of closing prices over the past 25 periods. The upper and lower rails are one standard deviation above and below the middle rail. When the price breaks through the upper or lower rail, it indicates that there is a breakout and abnormal price behavior, which can be used to make trading decisions.

If the price is below the lower rail, go long. If the price is above the upper rail, go short. When going long, set the stop loss to the entry price multiplied by the stop loss factor and take profit to the entry price multiplied by the take profit factor.

The strategy also incorporates some auxiliary rules, such as allowing only one signal per 24 hours to avoid unnecessary trading.

- Using Bollinger Bands to determine abnormal price ranges belongs to trend tracking strategies that can capture price trends.
- Stop loss and take profit parameters are set according to principles to control single loss.
- Some auxiliary rules are added to avoid duplicate signals and unnecessary trading.

- Bollinger Bands cannot fully represent price trends, and there may be false signals.
- Improper timing of breakout signals can lead to losses.
- The duration and momentum of trend or non-trend markets are difficult to predict, which may lead to unnecessary long positions.

Risk Management:

- Adjust Bollinger Band parameters to optimize breakout signal timing.
- Incorporate other indicators to determine the major trend.
- Set stop loss and take profit range according to different products and market conditions.

- Consider adaptive optimization of Bollinger Band parameters to make them fit better to current market conditions.
- Incorporate other indicators to judge reliability of trend signals and avoid false signals.
- Incorporate machine learning models to automatically identify optimal long and short timing.

In summary, this is a simple trend tracking strategy using Bollinger Bands to determine abnormal prices and track trends. There is room for improvement in parameter optimization, risk control and signal filtering, but the core idea is simple and clear, making it suitable as a beginner strategy for learning.

/*backtest start: 2023-11-18 00:00:00 end: 2023-12-18 00:00:00 period: 1h basePeriod: 15m exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=5 strategy("I11L OIL Bot",overlay=true, initial_capital=1000000,default_qty_value=1000000,default_qty_type=strategy.cash,commission_type=strategy.commission.percent,commission_value=0.00) leverage = input.float(1,"Leverage (x)",step=1) SL_Factor = 1 - input.float(1,"Risk Capital per Trade (%)", minval=0.1, maxval=100, step=0.05) / 100 / leverage TP_Factor = input.float(2, step=0.1) invertBuyLogic = input.bool(false) lookbackDistance = input.int(25) devMult = input.float(2,step=0.1) var lastSellHour = 0 var disableAdditionalBuysThisDay = false if(time > lastSellHour + 1000 * 60 * 60 * 6) disableAdditionalBuysThisDay := false if(strategy.position_size != strategy.position_size[1]) disableAdditionalBuysThisDay := true lastSellHour := time source = close //Trade Logic basis = ta.sma(source, lookbackDistance) dev = devMult * ta.stdev(source, lookbackDistance) upper = basis + dev lower = basis - dev isBuy = ta.crossunder(source, upper) isBuyInverted = ta.crossover(source, lower) plot(upper, color=color.white) plot(lower, color=color.white) strategy.initial_capital = 50000 if((invertBuyLogic ? isBuyInverted : isBuy) and not(disableAdditionalBuysThisDay)) strategy.entry("Long", strategy.long, (strategy.initial_capital / close) * leverage) if(strategy.position_size > 0) strategy.exit("SL Long", "Long", stop=strategy.position_avg_price * SL_Factor) strategy.close("Long", when=close > strategy.position_avg_price * (1 + (1 - SL_Factor) * TP_Factor), comment="TP Long")

- Momentum and Volume Trading Strategy
- Fractal Breakout Strategy
- Bill Williams Awesome Oscillator Trading Strategy
- Volatility Finite Volume Elements Strategy
- This BIST stocks 4-stage quantitative acquisition strategy
- Kifier's Hidden MFI/STOCH Divergence/Trend Breaker Trading Strategy
- MACD Quantitative Trading Strategy
- Dual Moving Average Trend Tracking Strategy
- A Momentum Tracking Mean Reversion Strategy
- Directional Movement Index Dual-direction Trading Strategy
- Laguerre RSI Trading Strategy
- Dynamic Re-entry Buy-only Strategy
- The Solid as a Rock VIP Quant Strategy
- Golden Cross Optimized Moving Average Crossover Trading Strategy
- Crossing Moving Average Strategy
- The Wave Trend Trading Strategy Based on LazyBear
- Eight Day Extended Run Strategy
- Moving Average Pullback Strategy
- Dynamic MA Crossover Trend Following Strategy
- Stochastic Moving Average Strategy