Skip to content

high - PineScript Variable

high records the highest traded price observed within the current bar. It updates whenever a new peak is registered.

  • Reference historical highs with high[1], high[2], etc., for breakout logic.
  • On synthetic chart types the value derives from the transformed price series.
  • Combine with low and close to calculate range or volatility metrics.
//@version=5
indicator("Daily high breakout", overlay=true)
length = input.int(20, "Lookback", minval=1)
highestHigh = ta.highest(high, length)
plot(highestHigh, "Rolling high", color=color.orange)
plotshape(high > highestHigh[1], title="Breakout",
location=location.abovebar, style=shape.labelup,
color=color.new(color.green, 0), text="Break↑")