As described in an article by John Ehlers' article "Modeling
The Market = Building Trading Strategies "
August 2006 of S & C Magazine
Formulas:
Instantaneous Trendline = MVA(Price, Length)+SmoothSlope/2, where
SmoothSlope[i] = (Slope[i]+2*Slope[i-1]+2*Slope[i-2]+Slope[i-3])/6,
Slope[i] = Price[i]-Price[i-Length+1].
Download: