Zero-Lag EMA Trend Following Strategy
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
-
Calculate fast and slow Zero-Lag EMA using different smooth periods.
-
Long signal is generated when fast EMA crosses above slow EMA, and short signal when fast EMA crosses below slow EMA.
-
Set trailing stop line after entry to follow highest/lowest price for risk control.
-
Take profit when price reaches certain percentage for profit taking.
-
Use open counts for pyramiding similar to compound interest.
Advantage Analysis
-
Zero-Lag EMA has less lag in responding to trend changes.
-
Dual EMA strategy is simple and intuitive for directional judgement.
-
Stop loss and take profit settings effectively control single trade loss.
-
Pyramiding mechanism allows more profits when trend extends.
Risk Analysis
-
Improper parameter settings may cause over-aggressive or over-conservative stop loss/take profit.
-
Wrong trend indicator may miss trend change moments.
-
Pyramiding can amplify total loss when trend reverses.
-
Parameters need tuning for different products to avoid overfitting.
Improvement Directions
-
Test different EMA periods to find better parameter combinations.
-
Optimize stop/take ratios to balance profitability and risk control.
-
Adjust pyramiding logic to limit max open count per direction.
-
Add other technical indicators for entry filter to improve signal quality.
-
Disable trading during specific hours to avoid wrong signal-prone periods.
-
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.
//@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")- 1
