In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.
study(title="Week",shorttitle="Monday", overlay=true) nt = input('0930-1030', type=session, title="Not Trading") nttime = nt bgPlot2 = (time(period, nttime)) bgcolor(bgPlot2 and (dayofweek(time('D')) == monday)? yellow : na,transp=30,title="Time")