indicator · on price · open source
Zero-Lag EMA
Running…
Loading chart…
About
Zero-Lag EMA (ZLEMA) removes most of the EMA's inherent lag by adding the difference between price and its lag-emulated version before smoothing. Almost no lag, at the cost of slightly more overshoot.
- Cuts the lag of a regular EMA roughly in half.
- Lower N for very tight, almost tick-by-tick turns.
- Combine with an ADX > 25 filter to dodge chop whipsaws.
Source code
//@version=5
indicator("Zero-Lag EMA", overlay=true)
len = input.int(21, "Length", minval=1, maxval=500)
src = input.source("close", "Source")
zlema = ta.ema(src + (src - src[math.floor((len - 1) / 2)]), len)
p_ZLEMA = plot(zlema, "ZLEMA", color=color.aqua, linewidth=2)
alertcondition(ta.crossover(close, zlema), "Price crosses above ZLEMA", "Price crossed above the ZLEMA")
alertcondition(ta.crossunder(close, zlema), "Price crosses below ZLEMA", "Price crossed below the ZLEMA")
No comments yet.
Sign in to comment.