OPEN-SOURCE SCRIPT

Highlight 10-11 AM NY

34
//version=5
indicator("Highlight 10-11 AM NY", overlay=true)

// Inputs for flexibility
startHour = input.int(10, "Start Hour (NY time)")
endHour = input.int(11, "End Hour (NY time)")

// Check if the current bar is within the session (uses chart time zone)
inSession = (hour(time, syminfo.timezone) >= startHour) and (hour(time, syminfo.timezone) < endHour)

// Highlight background
bgcolor(inSession ? color.new(color.yellow, 85) : na)

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.