Detrended Ehlers Leading Indicator

The Detrended Ehlers Leading Indicator(DELI) was authored by Jon Ehlers (See “MESA and Trading Market Cycles” by John Ehlers). The DELI uses highs, previous high, lows, previous lows and feedback to create two exponential moving averages. First, Detrended Synthetic Price (DSP) is plotted as their difference. Then a third exponential moving average is created from the DSP and the DELI is plotted as their difference. The period length is used but in a non traditional way. The user may change only this period length. This indicator’s definition is further expressed in the condensed code given in the calculation below.

Detrended Ethlers Leading Indicator

How To Trade Using The Detrended Ehlers Leading Indicator

Detrended Ehlers Leading Indicator may be used in conjunction with other indicators. No trading signals are given.

How To Access in MotiveWave

Go to the top menu, choose Study>Bill Mars>Detrended Ehlers Leading Indicator

or go to the top menu, choose Add Study, start typing in this study name until you see it appear in the list, click on the study name, click OK.

Important Disclaimer: The information provided on this page is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security. Please see our Risk Disclosure and Performance Disclaimer Statement.


//period = user defined, default is 14
//prev = previous, index = current bar number

prevHigh = high[index-1];
prevLow = low[index-1];
if (prevHigh moreThan high) high = prevHigh;
if (prevLow lessThan low) low = prevLow;
price = (high + low) / 2;
alpha = .67;
if (period moreThan 2) alpha = 2 / (period + 1);
prevEma1 = ifNull(price, ema1[index-1]);  //returns price on first try
ema1 = (alpha * price) + ((1 - alpha) * prevEma1);
prevEma2 = ifNull(price, ema2[index-1]);
ema2 = ((alpha/2) * price) + ((1 - (alpha/2)) * prevEma2);
Plot1: dsp = ema1 - ema2;
prevTemp = ifNull(0,temp[index-1]);
temp = (alpha * dsnp) + ((1 - alpha) * prevTemp);
Plot2: deli = dsp - temp;