Type/to search

EMA bands + Leledc + Bollinger bands trend following strategy

Cryptocurrency
Created: 2023-12-04 15:14:37
Last modified: 3 years ago
1
Follow
1779
Followers

img

Overview

This is a positional trend following strategy that utilizes a combination of EMA bands, Leledc exhaustion lines and Bollinger bands to identify trends and establish long or short positions when trend signals appear.

Strategy Logic

Open Conditions

  • Go long when price breaks out above the middle EMA bands (midpoint of high EMA and low EMA); go short when price breaks down below the middle EMA bands.

  • A slow EMA filter can be enabled, so that positions are opened only if close breaks the middle bands and slow EMA agrees.

  • Middle band bounce re-entry can be enabled, so that positions are reopened only if price touches the middle band again after initial middle band breakout.

Close Conditions

  • Select nearest band to close positions when price hits the opposite side of middle EMA bands.

  • Select opposite band to close positions when price completely breaks out the opposite side of middle EMA bands.

  • Delayed close inside bands can be selected to close positions if price trades inside middle bands for a number of periods.

  • Select close on Leledc bars to close positions when consecutive candles close strongly in one direction and reach recent high/low.

  • Select close on BB exhaustion bars to close positions when price reverts inside BB bands from overbought/oversold areas.

  • Select close on loss of Buy/Sell zones when price breaks significant long term support/resistance levels.

Counter Trend Entry Conditions

  • Counter trend positions can be enabled on appearance of Leledc or BB exhaustion bars, with added filter that extreme price must break inner or outer Buy/Sell zones.

  • Independent stop loss conditions can be configured for counter trend trades.

Advantages

  • EMA bands help clearly identify trend direction, avoiding choppy whipsaws.

  • Leledc exhaustion and BB reversioncombinely signal good times to take profit as trend finishes.

  • Counter trend trades allow range trading during consolidation while trend trading in persistent trends.

  • Visual plot of bands intuitively displays current trend strength.

Risks

  • EMA indicators are sensitive to parameter tuning, inappropriate EMA length can cause unprofitable whipsaw trades.

  • Leledc and BB bars as exhaustion signals may fail, thus missing chance to exit leading to large losses.

  • Counter trend trades significantly increase strategy risk, must be used with stop loss.

Enhancement Areas

  • Test different EMA lengths to find optimal values for different products and timeframes.

  • Fine tune Leledc and BB parameters to better identify trend exhaustion points.

  • Further optimize counter trend stop loss levels to balance risk reward.

  • Experiment with simple moving averages or other indicators to plot more stable middle bands.

Summary

This strategy consolidates various techniques of trend identification, exhaustion confirmation and counter trend scalping, offering rich functionality. With prudent parameter tuning and risk control, it can achieve solid risk adjusted returns and is worthy of further research and optimization.

Source
Pine
/*backtest
start: 2023-11-26 00:00:00
end: 2023-12-03 00:00:00
period: 2h
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/
// © danielx888
// Credits to Joy_Bangla for the Leledc exhaustion bar code
// Credits to VishvaP for the 34 EMA bands code
Strategy parameters
Strategy parameters
EMA Length
Source
Open Conditions
Enable middle EMA band breakout: Long
Enable middle EMA band breakdown: Short
Enable default positioning: Long
Enable default positioning: Short
Enable middle EMA band bounce re-entry: Long
Enable middle EMA band bounce re-entry: Short
Use slow EMA filter
Slow EMA Length
Close Conditions
Close on crosses through middle EMA bands
Delayed close no. of bars
Close on Leledc bars
Which Leledc bar?
Close on Bollinger Band exhaustion bars
Which BB exhaustion bar?
Close on loss of Buy/Sell zone
Which Buy/Sell zone?
Counter Trade Settings
Enable counter-trend trades: Long
Trigger
Enable counter-trend trades: Short
Trigger
Leledc/BB must be outside which Buy/Sell zone to open
Closing conditions for counter-trend longs
Closing conditions for counter-trend shorts
Flat stop-loss % for counter-trend longs
Flat stop-loss % for counter-trend shorts
Visual Elements
Show Slow EMA
Show Leledc Exhausion Bars
Enable Bollinger Bands exhaustion bar coloring
Enable Bollinger bands exhaustion bar background coloring
Enable Buy/Sell zone failure bar coloring
Enable Trend Bar Color
Bollinger Bands Exhaustion Bar Settings
Bollinger Bands SMA Period Length
Bollinger Bands Standard Deviation
RSI Period Length
RSI Oversold Value
RSI Overbought value
Leledc Exhaustion Bar Settings
Require Volume breakout for Leledc bars
Volume Multiplier
Source
Bar count no
Highest / Lowest
bindexSindex
Close
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)