traderstu22

TS2_Intraday_Times

58
Added warning column and made adjustments for 1,3 and 5 min intervals
Open-source script

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.

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.

Want to use this script on a chart?
//Created By ChrisMoody on 9-14-2014 To plot Background Highlights for Recurring Times
//Edited by TS2 with static time frame inspirations from TraderMentatlity: http://www.tradermentality.com/2016/02/intraday-reversal-times.html
// added prewarning time slots, cause sometimes, you want to know when the reversal might be coming

study(title="TS2_Intraday_Times", shorttitle="TS2_Intraday_Times",overlay=true)

use0 = input(true, title="Show 9:30-9:35")
use1 = input(true, title="Show 9:50-10:10")
use2 = input(true, title="Show 10:25-10:35")
use3 = input(true, title="Show 11:15")
use4 = input(true, title="Show 12:00")
use5 = input(true, title="Show 12:45")
use6 = input(true, title="Show 1:30")
use7 = input(true, title="Show 2:15")
use8 = input(true, title="Show 3:00")
use9 = input(true, title="Show 3:30")

useP = input(true, title="Show prewarning?")


sess0 = '0930-0935'
sess1p = (interval==1)?'0949-0950':(interval==3)?'0947-0950':'0945-0950'
sess1 = '0950-1010'
sess2p = (interval==1)?'1024-1025':(interval==3)?'1022-1025':'1020-1025'
sess2 = '1025-1035'
sess3p = (interval==1)?'1114-1115':(interval==3)?'1111-1114':'1110-1111'
sess3 = '1115-1116'
sess4p = (interval==1)?'1159-1200':(interval==3)?'1156-1159':'1155-1156'
sess4 = '1200-1201'
sess5p = (interval==1)?'1244-1245':(interval==3)?'1241-1244':'1240-1241'
sess5 = '1245-1246'
sess6p = (interval==1)?'1329-1330':(interval==3)?'1326-1329':'1325-1326'
sess6 = '1330-1331'
sess7p = (interval==1)?'1414-1415':(interval==3)?'1411-1414':'1410-1411'
sess7 = '1415-1416'
sess8p = (interval==1)?'1459-1500':(interval==3)?'1456-1459':'1455-1456'
sess8 = '1500-1501'
sess9p = (interval==1)?'1529-1530':(interval==3)?'1526-1529':'1525-1526'
sess9 = '1530-1531'

bgPlot0 = time(period, sess0)
bgPlot1p = time(period, sess1p)
bgPlot1 = time(period, sess1)
bgPlot2p = time(period, sess2p)
bgPlot2 = time(period, sess2)
bgPlot3p = time(period, sess3p)
bgPlot3 = time(period, sess3)
bgPlot4p = time(period, sess4p)
bgPlot4 = time(period, sess4)
bgPlot5p = time(period, sess5p)
bgPlot5 = time(period, sess5)
bgPlot6p = time(period, sess6p)
bgPlot6 = time(period, sess6)
bgPlot7p = time(period, sess7p)
bgPlot7 = time(period, sess7)
bgPlot8p = time(period, sess8p)
bgPlot8 = time(period, sess8)
bgPlot9p = time(period, sess9p)
bgPlot9 = time(period, sess9)

bgcolor(use0 and bgPlot0 > 0 ? yellow : na, transp=75)
bgcolor(use1 and bgPlot1p and useP > 0 ? blue : na, transp=75)
bgcolor(use1 and bgPlot1 > 0 ? yellow : na, transp=75)
bgcolor(use2 and bgPlot2p and useP > 0 ? blue : na, transp=75)
bgcolor(use2 and bgPlot2 > 0 ? yellow : na, transp=75)
bgcolor(use3 and bgPlot3p and useP > 0 ? blue : na, transp=75)
bgcolor(use3 and bgPlot3 > 0 ? yellow : na, transp=75)
bgcolor(use4 and bgPlot4p and useP > 0 ? blue : na, transp=75)
bgcolor(use4 and bgPlot4 > 0 ? yellow : na, transp=75)
bgcolor(use5 and bgPlot5p and useP > 0 ? blue : na, transp=75)
bgcolor(use5 and bgPlot5 > 0 ? yellow : na, transp=75)
bgcolor(use6 and bgPlot6p and useP > 0 ? blue : na, transp=75)
bgcolor(use6 and bgPlot6 > 0 ? yellow : na, transp=75)
bgcolor(use7 and bgPlot7p and useP > 0 ? blue : na, transp=75)
bgcolor(use7 and bgPlot7 > 0 ? yellow : na, transp=75)
bgcolor(use8 and bgPlot8p and useP > 0 ? blue : na, transp=75)
bgcolor(use8 and bgPlot8 > 0 ? yellow : na, transp=75)
bgcolor(use9 and bgPlot9p and useP > 0 ? blue : na, transp=75)
bgcolor(use9 and bgPlot9 > 0 ? yellow : na, transp=75)