Type/to search

Dual Moving Average Bollinger Band Trend Tracking Strategy

Cryptocurrency
Created: 2023-12-11 15:10:02
Last modified: 3 years ago
1
Follow
1779
Followers

img

Overview

This strategy determines the general market trend direction by calculating two exponential moving averages (EMA) over different timeframes, and identifies overbought and oversold opportunities along the trend direction using adaptive Bollinger Bands to implement trend trading.

Strategy Logic

  1. The 200-period EMA and 30-period EMA are calculated. If the 200 EMA is greater than the 30 EMA, the long-term trend is determined as up. Otherwise, it is determined as down.

  2. After the trend direction is determined, the baseline, upper band and lower band of the Bollinger Bands are calculated. The baseline adopts SMA over a configurable timeframe (e.g. 8 periods). The band width is a configurable multiplier (e.g. 1.3 and 1.1) of the amplitude of the highest and lowest prices over the same period as the baseline.

  3. When the long-term trend is up, the lower band breakout signals long entry; when the long-term trend is down, the upper band breakdown signals short entry.

  4. To filter false breakouts, the rate of change over the last candle before the breakout is checked to be below a configurable threshold (e.g. 3%), and the band width is checked to be greater than a configurable level (e.g. 2.2% of close price).

  5. After opening positions, configurable stop loss (e.g. -3%) and take profit (e.g. 10%) are set to lock in profits.

Strategy Strengths

  1. The dual EMAs define the major trend and avoid disorderly opening positions when the major trend is unclear.

  2. The adaptive Bollinger Bands set entry points along the trend. The auto width adjustment locks the trend further.

  3. The rate of change and the minimum width requirements effectively filter false breakouts.

  4. The stop loss and take profit settings reasonably lock profits while keeping risks under control.

Strategy Risks

  1. The dual EMAs fails to accurately locate trend reversal points, missing opportunity at trend turning points.

  2. Improper BB parameter settings may cause false signals.

  3. Fixed stop loss and take profit cannot adapt to market fluctuations.

Optimization Directions

  1. Incorporate other indicators to determine major and secondary trend reversals.

  2. Adopt dynamic adjustment of BB parameters.

  3. Set conditional orders for stop loss and take profit based on specific criteria.

Conclusion

This strategy implements trend trading by judging the major trend using dual EMAs and identifying opportunities with Bollinger Bands. Its strength lies in reasonably setting entry, stop loss and take profit conditions to lock in trend profits. There are also some risks, like failing to catch trend turning points and improper BB parameter settings. Further optimizations in these aspects will empower the strategy to seize trend profits better.

Source
Pine
/*backtest
start: 2022-12-04 00:00:00
end: 2023-12-10 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
//////////////////////////////////////////////////////////////////////
// Component Code Start
testStartYear = input(2019, "Backtest Start Year")
Strategy parameters
Strategy parameters
Backtest Start Year
Backtest Start Month
Backtest Start Day
Backtest Stop Year
Backtest Stop Month
Backtest Stop Day
Color Background?
v_input_8
v_input_9
length
factor1
factor2
changerate
exp
target
stop
minroe
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)