Laguerre Filter Adaptive
The Laguerre Filter Adaptive (LFA) was authored by John Ehlers. The LFA requires the highest and lowest of the difference of current price and previous price, some averaging, and a good deal of feedback to fill its calculation. The user may change the input (midpoint) and the period lengths. This indicator’s definition is further expressed in the condensed code given in the calculation below.
See also article by John Ehlers
How To Trade Using the Laguerre Filter Adaptive
The Laguerre Filter Adaptive 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>Laguerre Filter Adaptive
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 midpoint
//period1 = p1 = user defined, default is 20
//period2 = p2 = user defined, default is 5
//abs = function, returns absolute value of argument
//median = function, returns price at middle of period
//diff = difference, prev = previous
//index = current bar number
prevF = ifNull(price, filt[index-1]);
diff = Math.abs(price - prevF);
hh = highest(p1, DIFF);
ll = lowest(p1, DIFF);
if (hh - ll != 0) mid = (diff-ll) / (hh - ll);
if (hh - ll != 0)
alpha = median(p2, MID); //returns price at middle of p2
endIf
prevL0 = ifNull(price, LO[index-1]);
prevL1 = ifNull(price, L1[index-1]);
prevL2 = ifNull(price, L2[index-1]);
prevL3 = ifNull(price, L3[index-1]);
l0 = alpha*price + (1-alpha)*prevL0;
l1 = -(1 - alpha)*l0 + prevL0 + (1 - alpha)*prevL1;
l2 = -(1 - alpha)*l1 + prevL1 + (1 - alpha)*prevL2;
l3 = -(1 - alpha)*l2 + prevL2 + (1 - alpha)*prevL3;
Plot: filt = (l0 + 2*l1 + 2*l2 + l3) / 6;