Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 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. stamp = security("BITSTAMP:BTCUSD", period, close)
  11. finex = security("BITFINEX:BTCUSD",period,close)
  12. kraken = security("KRAKEN:BTCUSD", period, close)
  13. gbtc = security("OTC:GBTC",period,close)
  14.  
  15. avg = (coinbase+stamp+finex+kraken)/4
  16. diff = ok1w-avg
  17. diff2 = ok3m-avg
  18.  
  19. col = diff<0 ? red : diff>0 ? green : gray
  20. col2 = diff2<0 ? red : diff2>0 ? green : gray
  21.  
  22. hline(0,title="0")
  23. plot(diff2, style=area,linewidth=1,color=aqua)
  24. plot(diff, style=area,linewidth=1,color=yellow,transp=25)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement