I’m trying to create a zero lag EMA script but there seems to be an error with my syntax.
The formula (from https://www.technicalindicators.net/indicators-technical-analysis/182-zlema-zero-lag-exponential-moving-average) is:
Lag: [(n day’s period -1) /2 ]
Entry data for EMA: [Close + (Close - Close of the day lag ago)]
ZLEMA = EMA of (Entry data for EMA)
My script is (for a 50 period ZLEMA):
P1 = 50;
Lag = ((P1 - 1 ) / 2 );
EMA1 = (Close() + (Close() - Close(Lag) ) );
ZLEMA = EMA(EMA1);
Where am I going wrong?
Thanks
Steve