DELTA VOL
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © FJVL85

//@version=4

study("DELTA VOL",format=format.volume, precision=0)

//BUY AND SELL VOLUMEN//
buyvolume = iff( (high==low), 0, volume*(close-low)/(high-low))
abssellvolume = iff( (high==low), 0, volume*(high-close)/(high-low))
sellvol=0-abssellvolume
diffvol=buyvolume-abssellvolume
deltavol = iff((diffvol>0), (buyvolume) / (abssellvolume), (sellvol) / (buyvolume))

// PLOT INDICADOR
//plot(volume, style=plot.style_columns, color=color.blue, title="TOTAL V")
plot(buyvolume, style=plot.style_columns, color=color.green, title="BUY V")
plot(sellvol, style=plot.style_columns, color=color.red, title="SELL V")
plot(deltavol, style=plot.style_line, color=color.orange, title="DELTA")