I think this should do the trick:
//@version=2
study("volume_close")
vol_up = volume > volume[1]
//vol_dn = volume < volume[1]
close_up = close > (high+low)/2
close_dn = close < (high+low)/2
color = vol_up and close_up ? blue : vol_up and close_dn ? red : white
plot(volume, "vol_up_dn", color...