Advertisement
Guest User

Untitled

a guest
Apr 11th, 2020
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. //@version=2
  2.  
  3. study("Bitcoin Price Model v1.3", overlay=true)
  4.  
  5. //stock = security(stock, period, close)
  6. stock = security("QUANDL:BCHAIN/TOTBC",'M', close)
  7.  
  8. if(isweekly)
  9. //insert "TAB" key before stock
  10. stock = security("QUANDL:BCHAIN/TOTBC",'W', close)
  11. if(isdaily)
  12. //insert "TAB" key before stock
  13. stock = security("QUANDL:BCHAIN/TOTBC",'D', close)
  14.  
  15. FairPriceLine = exp(-5.48389898381523+stock*0.000000759937156985051)
  16.  
  17. FairPriceLineLoConfLimit = exp(-5.86270418884089+stock*0.000000759937156985051)
  18. FairPriceLineUpConfLimit = exp(-5.10509377878956+stock*0.000000759937156985051)
  19.  
  20. FairPriceLineLoConfLimit1 = exp(-5.66669176679684+stock*0.000000759937156985051)
  21. FairPriceLineUpConfLimit1 = exp(-5.30110620083361+stock*0.000000759937156985051)
  22.  
  23. plot(FairPriceLine, color=gray, title="FairPriceLine", linewidth=4)
  24.  
  25. show_FPLErrorBands = input(true, type=bool, title = "Show Fair Price Line Error Bands 95% Confidence 2St.Dev.")
  26. plot(show_FPLErrorBands ? FairPriceLineLoConfLimit : na, color=gray, title="FairPriceLine Lower Limit", linewidth=2)
  27. plot(show_FPLErrorBands ? FairPriceLineUpConfLimit : na, color=gray, title="FairPriceLine Upper Limit", linewidth=2)
  28.  
  29. show_FPLErrorBands1 = input(false, type=bool, title = "Show Fair Price Line Error Bands 68% Confidence 1St.Dev.")
  30. plot(show_FPLErrorBands1 ? FairPriceLineLoConfLimit1 : na, color=gray, title="FairPriceLine Lower Limit", linewidth=1)
  31. plot(show_FPLErrorBands1 ? FairPriceLineUpConfLimit1 : na, color=gray, title="FairPriceLine Upper Limit", linewidth=1)
  32.  
  33. TopPriceLine = exp(-30.1874869318185+pow(stock,0.221847047326554))
  34. TopPriceLineLoConfLimit = exp(-30.780909776998+pow(stock,0.220955789986605))
  35. TopPriceLineUpConfLimit = exp(-29.5940640866389+pow(stock,0.222738304666504))
  36.  
  37. TopPriceLineLoConfLimit1 = exp(-30.3683801339907+pow(stock,0.221575365176983))
  38. TopPriceLineUpConfLimit1 = exp(-30.0065937296462+pow(stock,0.222118729476125))
  39.  
  40. plot(TopPriceLine, color=white, title="TopPriceLine", linewidth=2)
  41.  
  42. show_TOPErrorBands = input(false, type=bool, title = "Show Top Price Line Error Bands 95% Confidence 1St.Dev.")
  43. plot(show_TOPErrorBands ? TopPriceLineLoConfLimit : na, color=white, title="TopPriceLine Lower Limit", linewidth=1)
  44. plot(show_TOPErrorBands ? TopPriceLineUpConfLimit : na, color=white, title="TopPriceLine Upper Limit", linewidth=1)
  45.  
  46. show_TOPErrorBands1 = input(false, type=bool, title = "Show Top Price Line Error Bands 68% Confidence 1St.Dev.")
  47. plot(show_TOPErrorBands1 ? TopPriceLineLoConfLimit1 : na, color=white, title="TopPriceLine Lower Limit", linewidth=1)
  48. plot(show_TOPErrorBands1 ? TopPriceLineUpConfLimit1 : na, color=white, title="TopPriceLine Upper Limit", linewidth=1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement