indicator · on price · open source

Recent High Low

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

About

Recent high/low channel — the highest high and lowest low over a rolling window. Acts as a quick range filter for breakouts and mean-reversion.

  • A short lookback (5–10) catches local extremes; a long one (50+) gives a structural channel.

Source code

//@version=5
indicator("Recent High Low", overlay=true)
len = input.int(20, "Lookback length", minval=2, maxval=200)
rh = ta.highest(high, len)
rl = ta.lowest(low, len)
p_Recent_High = plot(rh, "Recent High", color=color.red, style=plot.style_linebr)
p_Recent_Low = plot(rl, "Recent Low", color=color.green, style=plot.style_linebr)
alertcondition(ta.crossover(close, rh), "Break above high", "Close broke above the rolling high")
alertcondition(ta.crossunder(close, rl), "Break below low", "Close broke below the rolling low")

Comments

No comments yet.

Sign in to comment.