Hussarya Volume  cumulated. Buy Sell. 
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © hussarya

//@version=5
indicator("hussarya wolume Buy And Sell cumulated updated", format=format.volume)

c = input(true, "Wolumen binance + bybit + coinbase + okx + kraken")
log = input(false, "skala logarytmiczna log10")

x = timeframe.period

binance = request.security("BINANCE:BTCUSDT", x, volume)
bybit = request.security("BYBIT:BTCUSDT", x, volume)
coinbase = request.security("COINBASE:BTCUSDT", x, volume)
ftx = request.security("OKX:BTCUSDT", x, volume)
kucoin = request.security("KRAKEN:BTCUSDT", x, volume)



volume2 = binance + bybit + coinbase + ftx + kucoin


volume_sum = if c == false
    volume 
else
    volume2


zielona=((high-low)/(2*(high-low)-(close-open)))  //sila zakupu 
czerwona=((high-low)/(2*(high-low)-(open-close)))  //sila sprzedazy


buy = if open > close 
    volume_sum * zielona
else
    volume_sum - (volume_sum * czerwona)
   
    
sell = if open > close
    (volume_sum - buy)
else
    (volume_sum * czerwona)
    

c1 = if buy > sell
    volume_sum
else
    0 - volume_sum
    

a1 = buy
b1 = sell

//a1 /= if buy > sell 
//    buy
//else
//    0

//b1 = if buy < sell
//    sell
//else
//    0


volume_sum_log = math.log10(volume_sum)
a1_log = math.log10(a1)
b1_log = math.log10(b1)


wol = if log == false
    volume_sum
else
    volume_sum_log

aa = if log == false
    a1
else
    a1_log

bb = if log == false
    b1
else
    b1_log




plot(wol, style=plot.style_columns, color=#CCCCCC, title="Total volume")




//plot(aa, style=plot.style_columns, color=#00cc00, title="Buy Volume")


plot(bb, style=plot.style_columns, color=#cc0000, title="Sell Volume")

plot(aa, style=plot.style_columns, color=#00cc00, title="Buy Volume")



