Ehlers Filter

Ehlers Filter (EF) was authored, not surprisingly, by John Ehlers. The EF uses current prices, prior prices (determined by momentum length) and their difference over a time period to calculate its value. The user may change the input (close), period and momentum length. This indicator’s definition is further expressed in the condensed code given in the calculation below.

See also article by John Ehlers
 

Ehlers Filter

How To Trade Using Ehlers Filter

Ehlers Filter is a trend indicator and may be used in conjunction with other studies. No trading signals are calculated.

How To Access in MotiveWave

Go to the top menu, choose Study>John Ehlers>Ehlers Filter

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.

Calculation

//input = price, user defined, default is closing price
//period = p1 = user defined, default is 20
//momentum length = p2 = user defined, default is 5
//index = current bar number, LOE = less or equal

iprice = 0, priorP = 0, num = 0, sumC = 0;
coef[] = new [p1];
count = 0;
for(i = index - (p1-1); i LOE index; i++)
    iprice = price[i];
    priorP = price[i-p2];
    coef[count] = Math.abs(iprice - priorP);
    count++;
endFor
count = 0;
for(i = index - (p1-1); i LOE index; i++)
    iprice = price[i];
    num = num + coef[count] * iprice;
    sumC = sumC + coef[count];
    count++;
endFor
Plot: filt = num / sumC;