Volume for NiftyBN
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © blackhole07

//@version=4
study("Volume for NiftyBN", format=format.volume)

nifty_volume = security("NSE:NIFTY1!", timeframe.period, volume)
bn_volume = security("NSE:BANKNIFTY1!", timeframe.period, volume)

v = if(syminfo.ticker == "NIFTY")
    
    nifty_volume
    
else 
    
    if (syminfo.ticker == "BANKNIFTY")
    
        bn_volume
    
    else
        
        volume
        
palette =  open > close ? color.red : color.green
plot(v, color = palette, style=plot.style_columns, title="Volume", transp=65)

