Type/to search

Trading Strategy Based on Bollinger Bands and MACD

Cryptocurrency
Created: 2023-12-20 15:55:18
Last modified: 2 years ago
1
Follow
1779
Followers

img

Overview

This strategy combines Bollinger Bands and MACD indicator to identify oversold opportunities and trend reversals for quantitative trading. The strategy name is "Bollinger MACD Reversal Strategy".

Strategy Logic

The strategy first calculates 20-day Bollinger Bands, including middle band, upper band and lower band. When price touches the lower band, it considers the market oversold. At this point, combine with MACD indicator to judge whether the trend is reversing. If MACD histogram crosses above signal line positively, it determines the end of this round of decline, which corresponds to the buy signal.

Specifically, touching the Bollinger lower band and MACD histogram crossing signal line positively triggers the buy signal simultaneously. When close price rises above the stop loss level, it triggers the take profit signal.

Advantage Analysis

The strategy integrates Bollinger Bands to judge oversold zone and MACD to determine trend reversal signals, realizing relatively lower entry price. It also includes take profit methods to lock in profits and avoid losses.

In particular, the advantages are:

  1. Combining Bollinger Bands oversold zone and MACD indicator to achieve better entry points
  2. Using MACD indicator to determine trend reversal points, reducing false breakout probabilities
  3. Adopting stop loss/take profit methods to effectively control risks

Risk Analysis

There are still some risks mainly in the following aspects:

  1. Probability of Bollinger Bands breakout exists, which may cause failure in oversold zone judgement
  2. MACD histogram crossover could also be false one with judgement error probability
  3. Stop loss position setting may be improper, either too loose or strict, leading to insufficient defence or premature stop loss

To hedge against the above risks, we can take the following measures:

  1. Combine with other indicators to verify validity of Bollinger Bands breakout signals
  2. Add momentum indicators etc. as filters to avoid MACD false crossover
  3. Optimize and test different stop loss parameters

Optimization Directions

There is still room for further optimization, mainly including:

  1. Optimize Bollinger Bands parameters to find better oversold judgement schemes
  2. Add momentum indicators filters to improve MACD judgement validity
  3. Test stop loss methods like ATR to find better parameters
  4. Add trend judgement module to avoid counter trend trading
  5. Combine machine learning methods to train judgement models and improve overall strategy performance

Conclusion

The strategy integrates Bollinger Bands oversold zone judgement and MACD trend reversal indicator to achieve relatively better entry points. It also sets up stop loss/take profit methods to control risks. This is a worthwhile low buy high sell strategy to reference and optimize. Combined with more indicator filters and machine learning methods, there is still space to further improve its performance.

Source
Pine
/*backtest
start: 2023-11-19 00:00:00
end: 2023-12-19 00:00:00
period: 1h
basePeriod: 15m
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/
// © DojiEmoji

//@version=4
Strategy parameters
Strategy parameters
Backtest Start Time
Exit when Risk:Reward met
Risk:[Reward] (i.e. 3) for exit
ATR multiplier for stop loss
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)