Examples

Opening range

The high and low of the first minutes of the regular session, drawn as a box that extends through the day, with an alert when price closes outside it.

StrateScript
indicator "Opening range" { overlay: true }

minutes = input.int("Minutes", 15, min: 1, max: 120)

state hi = na
state lo = na
state zone = na

startOfRth = session.rth and not session.rth[1]
minsSinceOpen = bar.hour * 60 + bar.minute - 570   // 570 = 9:30 in minutes
inRange = session.rth and minsSinceOpen < minutes

if startOfRth {
  hi = high
  lo = low
  zone = box.new(bar.time, high, bar.time, low, color: #e8c15a15, border: #e8c15a)
} else if inRange and not na(hi) {
  hi = max(hi, high)
  lo = min(lo, low)
}

if not na(zone) and session.rth {
  zone.set_top(hi)
  zone.set_bottom(lo)
  zone.set_right(bar.time)
}

breakUp = session.rth and not inRange and close > hi and close[1] <= hi
breakDn = session.rth and not inRange and close < lo and close[1] >= lo
alert((breakUp or breakDn) and bar.confirmed, "Close outside the opening range")
marker(breakUp, shape: "arrow_up", location: "below", color: #26a69a)
marker(breakDn, shape: "arrow_down", location: "above", color: #ef5350)

What to notice:

STRATE / PRODUCT SCREENSHOT

Actual platform screenshot.