The Efficiency Ratio (ER), from Perry Kaufman, measures how directional price has been over a lookback window. It answers a single question: did price travel in a straight line, or did it thrash around and go nowhere?
Formula
ER = |close[t] - close[t - period]| / sum(|close[i] - close[i-1]|)The numerator is the net move over the window; the denominator is the total distance travelled. A straight run makes the two equal (ER = 1); a round trip makes the numerator tiny while the denominator stays large (ER near 0).
Output
One column, {name}, in the range 0 to 1:
- Near 1.0 - price moved in almost a straight line (strong trend).
- Near 0.0 - price chopped up and down but went nowhere (range).
Params
period- lookback window. Default 60.
Usage
The most common use is a chop filter. Add an entry filter
Efficiency Ratio is above 0.12 so the strategy only takes signals
when a real trend exists and sits out range-bound markets, where
trend-following signals tend to whipsaw.
- Short period (10-20) - entry-timing signal; reacts quickly.
- Long period (40-90) - regime filter; stays low through a multi-month range even when individual swings are large.
Why it beats ADX for ranges
A wide trading range can show large swings that keep ADX elevated, yet net price goes nowhere. ER reads the round trip directly: big swings with no net progress drive ER toward zero, so it flags the range that ADX can miss.
Pitfalls
- It is backward-looking. ER over the trailing window describes the regime that just happened; the very start of a new trend still reads low until the move accumulates.
- Threshold is asset- and timeframe-dependent. 0.12 suits daily crypto; tune it for other markets.
