Type/to search

Dynamic Stop Loss Bollinger Bands Strategy

Common strategy
Created: 2024-02-01 10:48:52
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

This strategy utilizes the upper and lower rails of Bollinger Bands to implement dynamic stop loss. It goes short when the price breaks through the upper rail and goes long when the price breaks through the lower rail. And it sets dynamic stop loss to track the price movement.

Principle

The core of this strategy lies in the upper and lower rails of Bollinger Bands. The middle rail is the n-day moving average. The upper rail is the middle rail + kn-day standard deviation. The lower rail is the middle rail − kn-day standard deviation. When the price bounces up from the lower rail, go long. When the price falls back from the upper rail, go short. At the same time, the strategy sets a stop loss point and dynamically adjusts it during the price movement to set a take profit point to implement prudent risk control.

Advantages

  1. Utilize Bollinger Bands' strong regression to middle rail characteristic to capture medium and long term trends;
  2. Clear long and short signals, easy to operate;
  3. Set dynamic sliding stop loss to maximize profit locking and control risks;
  4. Adjustable parameters to adapt to different market conditions.

Risks and Solutions

  1. Bollinger Bands may generate multiple long and short signals during range-bound markets, causing users to be trapped in whipsaws. The solution is to reasonably set stop loss points to control per trade loss.
  2. Improper parameter settings may lead to lower win rate. The solution is to reasonably optimize parameters for different products.

Optimization Directions

  1. Optimize moving average parameters to adapt to product characteristics;
  2. Add trend filtering to avoid range bound market;
  3. Combine with other indicators as filtering conditions to improve strategy stability.

Conclusion

This strategy utilizes Bollinger Bands' regression attributes along with dynamic sliding stop loss to obtain medium and long term trend profits while controlling risks. It is a highly adaptable and stable quantitative strategy. Through parameter optimization and logic optimization, it can be adapted to more products and obtain steady profits in live trading.

Source
Pine
/*backtest
start: 2024-01-24 00:00:00
end: 2024-01-31 00:00:00
period: 30m
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy(shorttitle="BB Strategy", title="Bollinger Bands Strategy", overlay=true)
length = input.int(20, minval=1, group = "Bollinger Bands")
maType = input.string("SMA", "Basis MA Type", options = ["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], group = "Bollinger Bands")
Strategy parameters
Strategy parameters
Bollinger Bands
length
Basis MA Type
Source
StdDev
Offset
Strategy
Long
Short
Target Multiplier (X)
AUTOMATION
Token (Optional)
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)