Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. //@version=4
  2. strategy("MSE", max_bars_back = 5000)
  3.  
  4. i = input(100, "Length")
  5.  
  6. //BitMEX Index
  7. vf = ((1 + ((cum(volume) - cum(volume[i])) - (cum(volume[i]) - cum(volume[2 * i]))) / (cum(volume[i]) - cum(volume[2 * i])))/highest((1 + ((cum(volume) - cum(volume[i])) - (cum(volume[i]) - cum(volume[2 * i]))) / (cum(volume[i]) - cum(volume[2 * i]))), i))
  8. simperformance() => (close - sma(close, i)) / stdev(close, i) * vf
  9.  
  10. index = security("(STRBTC + DASHBTC + ETHBTC + LTCBTC + EOSBTC + XMRBTC + XRPBTC)/7", timeframe.period, simperformance())//(close * vf)/stdev(close, i))
  11.  
  12. XBTUSD = security("Bitmex:XBTUSD", timeframe.period, simperformance())
  13. ETHUSD = security("Bitmex:ETHUSD", timeframe.period, simperformance())
  14. ETHU19 = security("Poloniex:ETHBTC", timeframe.period, simperformance())
  15. XRPU19 = security("Poloniex:XRPBTC", timeframe.period, simperformance())
  16. ADAU19 = security("Bittrex:ADABTC", timeframe.period, simperformance())
  17. EOSU19 = security("Bitfinex:EOSBTC", timeframe.period, simperformance())
  18. LTCU19 = security("Poloniex:LTCBTC", timeframe.period, simperformance())
  19. TRXU19 = security("Binance:TRXBTC", timeframe.period, simperformance())
  20.  
  21. ETH_MSE = (pow(XBTUSD - ETHU19, 2))
  22. XRP_MSE = (pow(XBTUSD - XRPU19, 2))
  23. ADA_MSE = (pow(XBTUSD - ADAU19, 2))
  24. EOS_MSE = (pow(XBTUSD - EOSU19, 2))
  25. LTC_MSE = (pow(XBTUSD - LTCU19, 2))
  26. TRX_MSE = (pow(XBTUSD - TRXU19, 2))
  27. index_MSE = (pow(XBTUSD - index, 2))
  28.  
  29. plot(index_MSE, "Index MSE", transp = 30, style = plot.style_line, linewidth = 4)
  30. plot(ETH_MSE, "ETH_MSE", transp = 90, style = plot.style_area)
  31. plot(XRP_MSE, "XRP_MSE", transp = 90, style = plot.style_area)
  32. plot(ADA_MSE, "ADA_MSE", transp = 90, style = plot.style_area)
  33. plot(EOS_MSE, "EOS_MSE", transp = 90, style = plot.style_area)
  34. plot(LTC_MSE, "LTC_MSE", transp = 90, style = plot.style_area)
  35. plot(TRX_MSE, "TRX_MSE", transp = 90, style = plot.style_area)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement