Nasdaq or US Composite Total Volume
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © TraderBotA

//@version=5
//This script intends to use the NASDAQ Composite total volume index, index ticker : TVOLQ, or the NYSE Composite total volume index, index ticker : TVOL, as a classical volume indicator on chart
indicator("Nasdaq or US Composite Total Volume", overlay=false)
src = input(title="SMA Lenght", defval=100)
i_sym = input.symbol("TVOLQ", "TVOLQ->NASDAQ TVOL->NYSE")
s = request.security(i_sym, 'D', close)
SMA = ta.sma(s,src)


plot(s, title="Growing & falling volume", color = open < close ? color.white : color.red, linewidth=2, style=plot.style_histogram)
plot (SMA, title="SMA", color=color.orange, linewidth=2, style=plot.style_line)
