What Is Zero Lag EMA

The zero-lag exponential moving average (ZLEMA) is a variation of the EMA, which adds a momentum term to reduce lag in the average to track current prices more closely.

The effect of the momentum term is to make recent prices ‘overweight’ and thus tracked closely, and with negative weights on past terms.

Zero Lag EMA Indicator

The Zero Lag EMA is a Trend indicator, and the primary aim is to eliminate the inherent lag associated with all trend-following indicators, which average a price over time.

How To Calculate Zero Lag EMA

Here’s how we can calculate the Zero Lag EMA

Lag = (Period-1)/2

Ema Data = {Data+(Data-Data(Lag days ago)) 

ZLEMA = EMA(EmaData,Period) 

Why Use Zero Lag EMA

The idea behind using Zero Lag EMA is to do a regular exponential moving average (EMA) calculation but on de-lagged data instead of doing it on the regular data. Data is de-lagged by removing the data from “lag” days ago, thus removing (or attempting to) the cumulative effect of the moving average.

How To Use Zero Lag EMA

Moving averages are usually calculated to identify the trend direction of a stock or to determine its support and resistance levels. 

Defining a Bullish Scenario to generate a buy signal:

  • When the price crosses above the ZLEMA, it indicates that the current price is greater than the average of the defined period; hence the market is in an upward trend.
  • When the shorter period moving average crosses over the longer time moving average, it indicates the start of a new uptrend.

Defining a Bearish Scenario to generate a sell signal:

  • When the price crosses down the ZLEMA, it indicates that the current price is lower than the average of the defined period; hence the market is in a downward trend.
  • When the shorter period moving average crosses down the longer time moving average, it indicates the start of a new downtrend.

Building Zero Lag EMA Strategy On Mudrex:

You can create strategies on Mudrex using simple ‘blocks’. You can connect multiple blocks and define conditions on those connections or ‘paths’ to create your strategy on Mudrex.

As discussed above, lets first write our entry/exit conditions so that we know what to do:

BUY: When price crosses up the ZLEMA.

SELL: When price crosses down the ZLEMA.

Overall Strategy: The overall strategy on mudrex looks like this

Testing: We can now run a quick back-test to see how our strategy performs

Other links:

A few quick references below:

Connect on our Discord: https://discord.gg/huZz3qP