+91-0000000000

}

Monday – Friday : 9:00 AM – 6:30 PM

Distance Coefficient Ehlers Filter

The Distance Coefficient Ehlers Filter, utilizing Amibroker data feed, is a filtering method developed by John Ehlers. This filter, potentially implemented through AFLs, aims to reduce noise and highlight significant market movements by emphasizing distance-based coefficients in price analysis.

/
_SECTION_BEGIN("Distance Coefficient Ehlers Filter");
//------------------------------------------------------------------------------

//
//  Taken from the article in TASC's April 2001 Issue.
//
//------------------------------------------------------------------------------

Price = (H+L)/2;
CoefLookback = 5;

Coef = (Price-Ref(Price, -1))^2+(Price-Ref(Price, -2))^2+(Price-Ref(Price, -3))^2+(Price-Ref(Price, -4))^2+(Price-Ref(Price, -5))^2;

SumCoef=0;
SumCoefPrice=0;
for(i=0; i < CoefLookback; i++) {
	SumCoef = SumCoef + Ref(Coef, -i);
	SumCoefPrice = SumCoefPrice + (Ref(Coef, -i) * Ref(Price, -i));
}
DCEF = SumCoefPrice / SumCoef;

Plot(Close, "Close", colorBlack, styleLine);
Plot(DCEF, "NonLinear Ehlers Filter", IIf(Close>DCEF, colorGreen, colorRed), styleLine);
_SECTION_END();

Open chat
1
Hi, how can I help you?