indicator · own pane · open source

Efficiency Ratio

Deepwick · @deepwickv1Updated 2 Oct 2026▲ 0 users
Running…
Loading chart…

About

Efficiency Ratio is Kaufman's ratio of net price movement to total path. 100 = perfectly straight, 0 = pure noise.

  • Above 30 = trending, below 30 = chop.
  • Raise Length for steadier readings.
  • Filter all your other systems by it — only take signals when ER > 30.

Source code

//@version=5
indicator("Efficiency Ratio", overlay=false)
len = input.int(10, "Length", minval=2, maxval=200)
src = input.source("close", "Source")
direction = math.abs(src - src[len])
path = math.sum(math.abs(ta.change(src)), len)
er = direction / path
erPct = 100.0 * er
hline(30, "Trending", color=color.gray, linestyle=hline.style_dashed)
hline(70, "Strong trend", color=color.gray, linestyle=hline.style_dashed)
p_ER = plot(erPct, "ER", color=color.teal, linewidth=2)
alertcondition(ta.crossover(erPct, 30), "ER enters trend", "Efficiency Ratio crossed above 30")
alertcondition(ta.crossunder(erPct, 30), "ER leaves trend", "Efficiency Ratio dropped below 30")

Comments

No comments yet.

Sign in to comment.