indicator · on price · open source

Pivot Range

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

About

Active pivot range — fills the area between the most recent confirmed swing high and swing low so the active trading range jumps off the chart.

  • Range updates only when a new pivot prints.
  • Reads as: light-blue box = current balance area, breaks above/below = trend signal.

Source code

//@version=5
indicator("Pivot Range", overlay=true)
swing = input.int(10, "Swing strength", minval=2, maxval=50)
ph = ta.pivothigh(high, swing, swing)
pl = ta.pivotlow(low, swing, swing)
lastPh = ta.valuewhen(not na(ph), ph, 0)
lastPl = ta.valuewhen(not na(pl), pl, 0)
p_RangeHigh = plot(lastPh, "RangeHigh", color=color.blue, style=plot.style_linebr)
p_RangeLow = plot(lastPl, "RangeLow", color=color.blue, style=plot.style_linebr)
fill(p_RangeHigh, p_RangeLow, color=color.new(color.blue, 90))

Comments

No comments yet.

Sign in to comment.