Plot futures volumes with index
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © traderprb

//@version=5
indicator('FS vol', overlay=true, precision=0, scale=scale.none)
fs = input.symbol(title='Select futures symbol', defval='NSE:BANKNIFTY1!')
bullish = input.color(title='Color for bullish volume bar', defval=color.green)
bearish = input.color(title='Color for bullish volume bar', defval=color.red)
transp = input.int(title='Transparency of volumes', defval=70, minval=25, maxval=95)
f() => [open, high, low, close]
[o, h, l, c] = request.security(fs, timeframe.period, f())
//plotcandle(o, h, l, c, color=o > c ? color.red : color.green)
Volume(symbol) => request.security(symbol,timeframe.period,volume)
plot(Volume(fs), style=plot.style_columns, color=o > c ? color.new(bearish, transp) : color.new(bullish, transp), editable=false)