The hour of the day of the current bar's open time, from 0 to 23, in the exchange time zone.
hour is a series int. Combine it with minute to build a time of day, such as hour * 60 + minute, and compare that with a session boundary.
Type
series int
Remarks
- hour[n] is na before the first bar.
- On Sidechair: the parts are read in the symbol's exchange time zone, the same as
syminfo.timezone. - hour runs on a 24-hour clock, so 4 pm reads 16. It is the hour the bar opened in, not the hour it closes in.
Example
//@version=6
indicator("Opening hour", overlay = true)
inHour = hour == 9 and minute >= 30 or hour == 10 and minute < 30
bgcolor(inHour ? color.new(color.orange, 85) : na)See also
Runs on Sidechair