Advertisement
Guest User

Untitled

a guest
Mar 5th, 2018
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. //Futures & GBTC Vs Spot
  2.  
  3. study(title = "Futures & GBTC Vs Spot", shorttitle = "Futures & GBTC Vs Spot")
  4.  
  5. len=input(5, minval=1)
  6.  
  7. ok3m = security("OKCOIN:BTCUSD3M",period, close)
  8. ok1w =security("OKCOIN:BTCUSD1W",period, close)
  9. coinbase = security("COINBASE:BTCUSD",period,close)
  10. usdcnh = security("FX_IDC:USDCNH",period,close)
  11. btccny = security("OKCOIN:BTCCNY",period,close)
  12. finex = security("BITFINEX:BTCUSD",period,close)
  13. gbtc = security("OTC:GBTC",period,close)
  14.  
  15. avg = (coinbase+finex)/2
  16. diff = ok1w-avg
  17. diff2 = ok3m-avg
  18. diff3 = ((gbtc*1000)-avg)
  19.  
  20. col = diff<0 ? red : diff>0 ? green : gray
  21. col2 = diff2<0 ? red : diff2>0 ? green : gray
  22.  
  23. hline(0,title="0")
  24. plot(diff3, style=area,linewidth=2,color=white)
  25. plot(diff2, style=area,linewidth=1,color=aqua)
  26. plot(diff, style=area,linewidth=1,color=yellow,transp=25)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement