Binance Big Open Interest Delta Change v2 
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © king_mob

//@version=4
study("Big OI Delta Change v2")


cursym = tostring(syminfo.tickerid)

symname = tostring(cursym + "_OI")


uchoc = security(symname, timeframe.period, close)
uchoo = security(symname, timeframe.period, open)

delt = abs(uchoo-uchoc)

len = input(type=input.integer, title="MA Length", defval = 50)

deltma = sma(delt, len)

mltp = input(type=input.float, title="multiplier", defval=3)

deltmp = deltma*mltp

a1 = delt > deltmp and uchoc > uchoo
a2 = delt > deltmp and uchoc < uchoo
a3 = delt < deltmp

bgcolor(a1 ? color.blue : na, title="BIG OI OPEN", transp=70)
bgcolor(a2 ? color.orange : na, title="BIG OI CLOSE", transp=70)

bgcolor(a3 ? color.white : na, title="n/a", transp=0)

