Attachments forums

Ehlers Distance Coefficient Filter Adaptive Moving Average

ionone, Thu Mar 12, 2026 8:53 pm

Ehlers Distance Coefficient Filter Adaptive Moving Average

This is a code that comes form TradingView but I think it's more appropriate here then in the other thread
it's also based on some Ehlers teachings, so...

What is the EDCF indicator?

The Ehlers Distance Coefficient Filter (EDCF) is a type of nonlinear adaptive FIR filter that calculates its smoothing weights on the fly based on the sum of squared price differences within the observation window.

Recent bars that are most different from the others in the window get the highest weight, which allows the filter to perform better than a similar Simple Moving Average (SMA) during trending conditions, but it reverts to a basic average when prices are stable.

It's an adaptive MA that has the particularity to be really responsive, especially during high momentum reversal. For example here :


I don't think it's as good as my LLAMA algorithm but it's still great:
here is a comparison between both (click on the image to see more clearly)
I personnally still think my LLAMA (Lag-Less Adaptive Moving Average) is a slight bit better
it's not at all the same logic though. mine isn't DSP

All files in topic