TradingView
jayy
Jul 22, 2015 8:50 PM

volume 5 min smiley Jayy 

Direxion Small Cap Bull 3X SharesArca

Description

This script plots volume. Intraday volume forms a smiley high at both ends and low in the middle at least for the cash session which is what this script concerns itself with. I created this as a curiosity but I figure others might be interested. If you are using 5 min charts then it will also plot the average for that particular time slot going back 10, 20 or 30 days and presents the mean for that bar as a black line. It also calculates the standard deviation over that period of time. Clearly the volume data is positively skewed so the mean and standard deviation are a little misleading. That aside it does provide a interesting perspective. The script likely could be reduced in size to accomplish the same thing with less tedium but it is what it is.
I likely will add an option for 15 minutes in the future.
If you are using BATS data you will find errors in low volume stocks because BATS data sometimes misses bars. The calculation relies on 78 5 min bars in a day (9:30 to 16:00 hrs). I built a little checker in the format. If the red line does not show at the beginning of the day then smiley will not work. For example SPY works well but NUGT does not. I have not found an issue will real time data.

There are a few options for bar colouring. They will be obvious when you play with them. current close versus last close, close versus open and volume relative to last bar.
More