//@version=6 indicator("IMG 30 — Confirmed Level Audit", overlay=true) // Levels begin on the knowledge bar, never backdated to the pivot. int leftBars = input.int(3, "Bars left", minval=1) int rightBars = input.int(3, "Bars right", minval=1) float ph = ta.pivothigh(high, leftBars, rightBars) float pl = ta.pivotlow(low, leftBars, rightBars) var float lastHigh = na var float lastLow = na bool highKnown = barstate.isconfirmed and not na(ph) bool lowKnown = barstate.isconfirmed and not na(pl) if highKnown lastHigh := ph if lowKnown lastLow := pl plot(lastHigh, "Confirmed high reference", color=color.black, style=plot.style_stepline) plot(lastLow, "Confirmed low reference", color=color.gray, style=plot.style_stepline) plotshape(highKnown, "High becomes known", shape.circle, location.abovebar, color.black, size=size.tiny) plotshape(lowKnown, "Low becomes known", shape.circle, location.belowbar, color.gray, size=size.tiny)