indicator · on price · open source

Ehlers BandPass Filter

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

About

Ehlers BandPass Filter — a 2-pole bandpass that isolates a specific cycle band in the price series. Great for cycle traders who want to see just the swing component, not the noise.

  • Center the passband by adjusting len (period in bars).
  • Buy dips near the lower envelope, sell near the upper.

Source code

//@version=5
indicator("Ehlers BandPass Filter", overlay=true)
len = input.int(20, "Period", minval=5, maxval=100)
src = close - close[7]
var float bp = 0.0
bp := 0.5 * src - 0.5 * src[2] + 0.84 * (nz(bp[1]) + nz(bp[3]))
hline(0, "Zero", color=color.gray)
p_BandPass = plot(bp, "BandPass", color=color.orange, linewidth=2)
alertcondition(ta.crossover(bp, 0), "Cycle up", "BandPass crossed above zero")
alertcondition(ta.crossunder(bp, 0), "Cycle down", "BandPass crossed below zero")

Comments

No comments yet.

Sign in to comment.