CGS

FuturesVsSpot

142 1 16
Btc futures vs spot indicator

Made by thedudebtc
Remove from Favorite Scripts Add to Favorite Scripts
//Futures vs Spot

 
study(title = "FuturesVsSpot", shorttitle = "FuturesVsSpot")
 

ok3m = security("OKCOIN:BTCUSD3M",period, close)
ok2w = security("OKCOIN:BTCUSD2W",period, close)
ok1w =security("OKCOIN:BTCUSD1W",period, close)
stamp = security("BITSTAMP:BTCUSD",period,close)
usdcnh = security("FX_IDC:USDCNY",period,close)
btccny = security("OKCOIN:BTCCNY",period,close)
finex = security("BITFINEX:BTCUSD",period,close)

cny2usd = btccny/usdcnh

avg = (stamp+finex)/2
diff = ok1w-avg
diff2 = ok3m-avg
diff4 = ok2w-avg
diff3 = cny2usd-avg
 
col = diff<0 ? red : diff>0 ? green : gray
col2 = diff2<0 ? red : diff2>0 ? green : gray
 
hline(0,title="0")
plot(diff2, style=area,linewidth=1,color=aqua,transp=15)
plot(diff4, style=area,linewidth=1,color=yellow,transp=10)
plot(diff, style=area,linewidth=1,color=orange,transp=40)

plot(diff3, style=line, linewidth=2, color=white)
Awesome, added to favorite scripts
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out