Badlo
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © bensonsuntw
// updation inspired by Morty

//@version=4
study("Badlo")

s1 = input(title="pair1",type=input.symbol,defval="NSE:NIFTY1!")
s2 = input(title="pair2",type=input.symbol,defval="NSE:BANKNIFTY1!")

f() => [open,high,low,close]

[o1,h1,l1,c1]=security(s1,timeframe.period,f())
[o2,h2,l2,c2]=security(s2,timeframe.period,f())


plotcandle((o2/2-o1)*2, (h2/2-h1)*2, (l2/2-l1)*2, (c2/2-c1)*2,color = (o2/2-o1)*2< (c2/2-c1)*2? color.green : color.red, wickcolor=color.black)


