TradingView
webbie
25 Feb 2016 pukul 19.21

Index Volume 

NASDAQ Composite IndexNASDAQ

Deskripsi

If you need to put the index volume on either the Nasdaq Composite (NASX) or NYSE (NYA), this will do it for you. Enjoy!
Komentar
JJtraderJJ
Thanks for shearing. It is possible that the volume bar color change according to previous closed? as we can choose on in the default tredingview volume options. Tx
vns_ram1
@JJtraderJJ, below is the code.

// Index Volume: Dow Jones Index Volume
study("Index Volume")
// use TVOLQ for Nasdaq Composite, TVOL for NYSE Composite, TVOL.DJ for Dow Jones
s = security("TVOL.DJ", "D", close)
// use IXIC for Nasdaq Composite, NYA for NYSE Composite, DJI for Dow Jones
i = security("DJI", "D", close)
MA = sma(s,50)
plot(s, color = i > i[1] ? green : red, linewidth=4, style=histogram)
plot (MA, color=orange, linewidth=2)
Lebih lanjut