OPEN-SOURCE SCRIPT

Market Hours Highlight

79
//version=5
indicator("Market Hours Highlight", overlay=true)

// Set your time zone (adjust if needed)
tz = "America/Chicago"

// Define session time for regular market hours (CT)
startTime = timestamp(tz, year, month, dayofmonth, 8, 30)
endTime = timestamp(tz, year, month, dayofmonth, 15, 0)

// Check if current bar is during market hours
isMarketOpen = time >= startTime and time < endTime

// Highlight background only during market open hours
bgcolor(isMarketOpen ? color.new(color.green, 85) : na)

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.