All indicators

EDCF: Ehlers Distance Coefficient Filter

A weighted average whose weights are each bar's summed squared distance from the bars before it, so it turns quickly on sharp moves.

BTCUSD1h
Fixed data to Oct 6, 2026, UTC
Loading the chart

The Distance Coefficient Filter is a finite window average with weights that adapt to price. For each of the last length prices it adds up the squared differences between that price and each of the length - 1 prices before it. That sum is the bar's weight.

The filter is the sum of weight times price divided by the sum of the weights. In a flat stretch the weights are nearly equal and the filter behaves like a simple average. When price moves sharply, the bars around the move are far from their neighbours, get much larger weights and pull the filter toward them, so it turns quickly and then settles. The weights reach back 2 x (length - 1) bars, so until that much history exists the line shows the price itself, and a perfectly flat window, where every weight is zero, also falls back to the price.

How to read EDCF: Ehlers Distance Coefficient Filter

Use it like an adaptive moving average. In quiet conditions it is smooth and close to a simple average; when price breaks out it moves to the new level faster than a fixed average would. Price holding above a rising line shows upward pressure, and below a falling line downward pressure.

Its speed comes from weighting outlier bars heavily, so a single sharp spike can tug the line noticeably until it leaves the window. The first bars of the chart show the raw price rather than a filtered value.

Settings

Length
The number of prices averaged and the distance window for each weight. Larger is smoother with more lag.
Source
The price series the filter runs on. The bar midpoint, high plus low over two, by default.

Frequently asked questions

Why does the line equal price at the start of the chart?

Each value needs 2 x (length - 1) bars of history to compute every distance. Until then the line shows the price itself rather than a partial average.

Why does it react quickly to breakouts?

Bars that sit far from their neighbours get large weights, so the prices right after a sharp move dominate the average and the line jumps toward them.

What happens in a perfectly flat market?

Every distance is zero, so every weight is zero and there is no average to take. The line falls back to the current price.

Write your own in OpenScript

Every study here is plain OpenScript. Change a setting, combine two, or turn one into a strategy, then backtest it in /trading and run it in sandbox trading (analyzer mode in OpenAlgo) before going further.