Type/to search

Dual Moving Average Bollinger Bands Trend Following Strategy

Common strategy
Created: 2023-11-01 14:15:11
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

This strategy makes trading decisions based on dual moving average Bollinger Bands to follow the trend. It uses the convergence and divergence of the upper and lower rails of Bollinger Bands to determine trend changes, buying near the lower rail and selling near the upper rail, to achieve buying low and selling high.

Strategy Logic

The strategy applies both simple Bollinger Bands and enhanced Bollinger Bands.

Simple Bollinger Bands use SMA of close prices for the middle band, while enhanced Bollinger Bands use EMA of close prices.

The upper and lower bands are calculated by middle band ± N standard deviations.

The strategy judges the strength of the trend based on the spread between the upper and lower bands. When the spread is below a threshold, it indicates the beginning of a trending period for trend following.

Specifically, when price approaches the lower band, it longs. When price approaches the upper band, it closes the position. The stop loss method is fixed percentage. Trailing stop can also be enabled.

Take profit depends on closing near the middle band or upper band.

The strategy can also choose to only sell at a profit to prevent losses.

Advantage Analysis

The advantages of this strategy:

  1. Dual Bollinger Bands improves efficiency

By comparing simple and enhanced Bollinger Bands, it can choose the better version for higher efficiency.

  1. Spread judges trend strength

When spread narrows, it indicates a strengthening trend. Following the trend has a higher win rate.

  1. Flexible profit taking and stop loss

Fixed percentage stop loss controls single trade loss. Take profit near middle or upper band. Trailing stop locks in more profit.

  1. Protective mechanism against losses

Only selling at a profit prevents loss from expanding.

Risk Analysis

The risks include:

  1. Drawdown risk

Trend following itself carries drawdown risks. Need to endure consecutive losses mentally.

  1. Whipsaw risk

When bands are wide, market may turn sideways. The strategy is less effective. Need to pause trading until trend resumes.

  1. Stop loss triggered risk

Fixed percentage stop loss may be too aggressive. Need more moderate stop like ATR stop.

Optimization Directions

The strategy can optimize on:

  1. Bollinger Bands parameters

Test different MA lengths, standard deviation multiples to find optimal combinations for different markets.

  1. Add filters

Add filters like MACD, KD on top of Bollinger signal to reduce trades during whipsaw markets.

  1. Profit taking and stop loss

Test different trailing stop methods. Or optimize stop loss based on volatility, ATR etc.

  1. Money management

Optimize position sizing per trade. Test different add-on strategies.

Conclusion

This strategy combines the strengths of dual Bollinger Bands, judging trend strength by band width and trading pullbacks during trends. It also sets proper stop loss to control risks. Further improvements can be made through parameter optimization and adding filters.

Source
Pine
/*backtest
start: 2023-10-01 00:00:00
end: 2023-10-31 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/
// © JCGMarkets 

//@version=4
Strategy parameters
Strategy parameters
Select Strategy System
Trade on Simple Bollinger Bands
Trade on Augmented Bollinger Bands
Technical Inputs
Periods for Moving Average
Std
Strategy Inputs
Max Spread Tolerance Beetween Bands
Entry data source
Exit data source
Profit to band:
Stop Loss %
Activate trailing stop?
Trailing %
Only sell in profit (Stop Loss still active)
Date Control
===> From
from year
from month
from day
===> To
To year
To month
To day
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)