If you need to put the index volume on either the Nasdaq Composite (NASX) or NYSE (NYA), this will do it for you. Enjoy!
// Index Volume: webbie : 25/FEB/2016 14:00 : 1.0 study("Index Volume") // use TVOLQ for Nasdaq Composite, TVOL for NYSE Composite s = security("TVOLQ", "D", close) MA = sma(s,50) plot(s, color = s > s[1] ? green : red, linewidth=4, style=histogram) plot (MA, color=orange, linewidth=2)