## Ehlers Filter Distance Coeff

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

### How To Trade Using Ehlers Filter Distance Coeff

Ehlers Filter Distance Coeff 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 Distance Coeff

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
index = current bar number, LOE = less or equal

```iprice = 0, priorP = 0, num = 0, sumC = 0, filt = 0;
coef[] = new [p1];
d2[] = new [p1];
count = 0;
for(i = index - (p1-1); i LOE index; i++)
d2[count] = 0;
iprice = price[i];
for( lb = 1; lb lessThan p1; lb++)
priorP = price[i-lb];
d2[count] = d2[count] + (iprice - priorP) * (iprice - priorP);
endFor
coef[count] = d2[count];
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
if (sumC != 0) filt = num / sumC;
Plot: filt```