Un truc comme ça pourrait peu être te convenir ?
// VOLUME BEAR BULL PERCENT GABRI
//period=22
if close>=open then
greenbarcount=1
greenvolume=volume
redbarcount=0
redvolume=0
else
greenbarcount=0
greenvolume=0
redbarcount=1
redvolume=volume
endif
//media volumi rossi e verdi per media mobile semplice
mmred=summation[period](redvolume)/summation[period](redbarcount)
mmgreen=summation[period](greenvolume)/summation[period](greenbarcount)
den=mmred+mmgreen
if den<>0 then
rapp=100*mmgreen/den
massimo=100
else
rapp=0
massimo=0
endif
return massimo coloured (210,0,0) style (histogram),rapp coloured (0,210,0) style (histogram), 50