hour - Pine Script Variable
Overview
Section titled “Overview”Current bar hour in exchange timezone.
intQualifier
Section titled “Qualifier”series
Remarks
Section titled “Remarks”- Returns the hour based on the bar’s opening time in the exchange timezone.
- Combine with
minuteandsecondwhen building session filters or time gates.
Example
Section titled “Example”//@version=6indicator("Opening hour highlight", overlay=true)
openHour = input.int(9, "Open hour")
isOpenHour = hour == openHourbgcolor(isOpenHour ? color.new(color.green, 90) : na)