JamesPowell

Session bars

this script marks off the extended hours trading for NY session. Shades the off hours and overnight data. Highlights the regular trading session for NY session. It can be adjusted for any particular market.

I use it specifically to show the missing data on the SPY as compared with the continuous data on the SPX500 .
Remove from Favorite Scripts Add to Favorite Scripts

Comments



If i pasted this picture correctly the chart on the left is the SPX500 and on the right is the SPY. Notice on the left chart each shaded area has two blue vertical lines and the chart on the right appears to have only one blue vertical line. In fact there are two lines on the right chart as well. They are laid over each other is all. The same script if applied to both charts. The chunk of data between the two bars on the left chart is simply just not recorded on the chart on the right. The grey area on the right hand chart is there because i have the extended hours data button pressed so it reflects in the graph.

Often what appears to us as a gap on the SPY chart is smoothed out and explained by the continuous data on the left hand chart of the SPX500. There really is no "gap" really, only a lack of recorded data on one chart compared to the other.
+2 Reply
Thank you
Reply
@Gwalleo, you are welcome. If you are interested we have a nice public chat room here on tradingview just follow this link https://www.tradingview.com/chat/#GLTODfGzJGbU1YVv
Reply
This doesn't work for me, all I see is green.
Reply
JamesPowell Melegito2018
@Melegito2018, use the settings button and change the colors and settings to your preference. You can also change to time as well if need be.
Reply
Melegito2018 JamesPowell
@JamesPowell, I don't know how to change something that doesn't make sense. At this point I tried to take out both t0 and t1 just to see what t will do. I think // means comment, but it doesn't work as I still have green and red. Why can't I upload picture here?!
t=time(period,"0930-0910")
//t0=time(period, "2000-2030")
//t1=time(period, "0400-0400")
//bgcolor(color = na ( t0 ) ? na:blue, transp=60)
//bgcolor(color = na ( t1 ) ? na:red, transp=60)
bgcolor(color = na ( t ) ? red:green, transp=70)
plot(close)

What I have under style backgroud color is 0 and 1.
On the chart I have green from Dec 10 14 and red from Dec 14 to 17 (that is weekend.) still makes no sense to me.
Reply
Melegito2018 Melegito2018
@Melegito2018, ok, my mistake, changed it to 9030-9040 now the green works but I still have the red. But the only reason I changed your original was that it was just gree.
Reply
Melegito2018 Melegito2018
@Melegito2018, Now all I have is this :
study("Session bars", overlay=true)
t=time(period,"0930-1600")
bgcolor(color = na ( t ) ? red:green, transp=70)

And the 5 day chart is all green. and under style, there is color 0 and color 1
What is red:green or na:blue ?
Reply
JamesPowell Melegito2018
@Melegito2018 I just PM'd you. Perhaps I can help. Look for my private message to you.
Reply
hoahauservice17 JamesPowell
@JamesPowell,

I am from Vietnam . When i install "Session bar " But open hour on Tradingview is 23 PM . How do i can fix it ?Thank you for strong support
Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Referred friends Coins My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out