The Detrended Ehlers Leading Indicator(DELI) was authored by Jon Ehlers (See “MESA and Trading Market Cycles” by John Ehlers).
Detrended Synthetic Price is a function that is in phase with the dominant cycle of real price data. This one is computed by subtracting a 3 pole Butterworth filter from a 2 Pole Butterworth filter. Ehlers Leading Indicator gives an advanced indication of a cyclic turning point. It is computed by subtracting the simple moving average of the detrended synthetic price from the detrended synthetic price.
I translated the code found here: https://www.motivewave.com/studies/detrended_ehlers_leading_indicator.htm
//Detrended Ehlers Leading Indicator
//by AlexF
//period=14
if high>high[1] then
prevhigh=high
endif
if low<low[1] then
prevlow=low
endif
price=(prevhigh+prevlow)/2
if barindex>2 then
alpha=2/(period+1)
else
alpha=.67
endif
alpha2=alpha/2
ema1=(alpha*price)+((1-alpha)*Ema1)
ema2=((alpha2)*price)+((1-alpha2)*Ema2)
dsp=ema1-ema2
temp=(alpha*dsp)+((1-alpha)*temp)
deli=dsp-temp
return deli as "DELI", 0 as "ZERO"
Great work, you should submit it to the library! Submit code to the library
Nicolas,
I already submitted it!
It’s still in pending approval.
oh sorry, I’m back from leave and did not check that yet. Will do asap. Thank you!