Type/to search

Zero-Lag EMA Trend Following Strategy

Cryptocurrency
Created: 2023-09-20 14:30:03
Last modified: 3 years ago
1
Follow
1781
Followers

Overview

This is a typical trend following strategy. It uses fast and slow Zero-Lag EMA to determine trend direction, and incorporates mechanisms like trailing stop, take profit and pyramiding to follow trends.

Strategy Logic

  1. Calculate fast and slow Zero-Lag EMA using different smooth periods.

  2. Long signal is generated when fast EMA crosses above slow EMA, and short signal when fast EMA crosses below slow EMA.

  3. Set trailing stop line after entry to follow highest/lowest price for risk control.

  4. Take profit when price reaches certain percentage for profit taking.

  5. Use open counts for pyramiding similar to compound interest.

Advantage Analysis

  1. Zero-Lag EMA has less lag in responding to trend changes.

  2. Dual EMA strategy is simple and intuitive for directional judgement.

  3. Stop loss and take profit settings effectively control single trade loss.

  4. Pyramiding mechanism allows more profits when trend extends.

Risk Analysis

  1. Improper parameter settings may cause over-aggressive or over-conservative stop loss/take profit.

  2. Wrong trend indicator may miss trend change moments.

  3. Pyramiding can amplify total loss when trend reverses.

  4. Parameters need tuning for different products to avoid overfitting.

Improvement Directions

  1. Test different EMA periods to find better parameter combinations.

  2. Optimize stop/take ratios to balance profitability and risk control.

  3. Adjust pyramiding logic to limit max open count per direction.

  4. Add other technical indicators for entry filter to improve signal quality.

  5. Disable trading during specific hours to avoid wrong signal-prone periods.

  6. Test parameters separately on different products to improve robustness.

Summary

The strategy shows overall stable running with decent risk-adjusted returns. It can be further improved via parameter optimization, auxiliary filtration etc. Also need to watch out potential signal errors in certain market conditions. Overall this strategy has a sound framework and shows potential to become a steady profitable trend following strategy after continuous refinements.

Source
Pine
//@version=3
// Learn more about Autoview and how you can automate strategies like this one here: https://autoview.with.pink/
strategy("MP ZeroLag EMA", "MP 0 Strat", overlay=true, pyramiding=0, initial_capital=100000, currency=currency.USD, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, commission_type=strategy.commission.percent, commission_value=0.1)
 
//bgcolor ( color=black, transp=40, title='Blackground', editable=true)
 
///////////////////////////////////////////////
//* Backtesting Period Selector | Component *//
///////////////////////////////////////////////
 
testStartYear = input(2018, "Backtest Start Year")
testStartMonth = input(3, "Backtest Start Month")
Strategy parameters
Strategy parameters
Backtest Start Year
Backtest Start Month
Backtest Start Day
Backtest Stop Year
Backtest Stop Month
Backtest Stop Day
ZeroLag EMA Source
ZeroLag EMA Fast Length
ZeroLag EMA Slow Length
Longs Only
Shorts Only
Flip the Opens
Pyramiding less than
Pyramiding equal to
Pyramiding greater than
Trailing Stop
Activate Trailing Stop Price (%). Divided by 100 (1 = 0.01%)
Trailing Stop (%). Divided by 100 (1 = 0.01%)
Take Profit
Take Profit (%). Divided by 100 (1 = 0.01%)
Stop Loss
Stop Loss (%). Divided by 100 (1 = 0.01%)
Lookback Period
Resolution
Number of Fibonacci Volatility Deviations
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)