Advertisement
Guest User

Shaohao BTC Volume Sum

a guest
Feb 22nd, 2018
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. //@version=3
  2. study("SH BTC Volume Sum", precision=0)
  3.  
  4. //(BITFLYER:BTCJPY/FX:USDJPY+KORBIT:BTCKRW/FX_IDC:USDKRW+COINBASE:BTCEUR*FX:EURUSD+BITFINEX:BTCUSD+KRAKEN:XBTUSD+COINBASE:BTCUSD)/6
  5.  
  6. ma = input(title="Moving Average", defval=21, minval=1)
  7. thresh = input(title="Threshold", type=float, defval=0.5, minval=0.1)
  8.  
  9.  
  10. bitflyer = security("BITFLYER:BTCJPY", period, volume)
  11. korbit = security("KORBIT:BTCKRW", period, volume)
  12. bitfinex = security("BITFINEX:BTCUSD", period, volume)
  13. coinbase = security("COINBASE:BTCUSD", period, volume)
  14. kraken = security("KRAKEN:XBTUSD", period, volume)
  15.  
  16. vol = bitflyer + korbit + bitfinex + coinbase + kraken
  17. smaVol = sma(vol, ma)
  18. ratio = (vol - smaVol) / vol
  19.  
  20. redCol = ratio >= thresh ? red : maroon
  21. greenCol = ratio >= thresh ? lime : green
  22. barCol = open > close ? redCol : open < close ? greenCol : gray
  23.  
  24. plot(vol, style=columns, color=barCol)
  25. plot(smaVol, color=yellow, linewidth=2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement