Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. //@version = 2
  2. study(title="test")
  3.  
  4. source = close
  5. fastLength = input(12, minval=1)
  6. slowLength=input(26,minval=1)
  7. signalLength=input(9,minval=1)
  8.  
  9. // res5 mutiplies the current interval which is an integer by a factor 5 and turns it into a string with the value of "interval*5" or "1D" depending on the value of interval*5
  10.  
  11. res5= interval*5 < 1440 ? tostring(interval*5) : "1D"
  12.  
  13. src5=security(tickerid, res5, close)
  14.  
  15. fastMA5 = ema(src5, fastLength)
  16. slowMA5 = ema(src5, slowLength)
  17.  
  18. macd5 = fastMA5 - slowMA5
  19. signal5 = sma(macd5, signalLength)
  20. outMacD5 = security(tickerid, res5, macd5)
  21.  
  22. plot( outMacD5 ? outMacD5 : na, color= red)
  23.  
  24. //@version = 2
  25. study(title="test")
  26.  
  27. source = close
  28. fastLength = input(12, minval=1)
  29. slowLength=input(26,minval=1)
  30. signalLength=input(9,minval=1)
  31.  
  32. // res5 mutiplies the current interval which is an integer by a factor 5 and turns it into a string with the value of "interval*5" or "1D" depending on the value 9of inteval*5
  33.  
  34. //res5= interval*5 < 1440 ? tostring(interval*5) : "1D"
  35.  
  36. res5= interval*5 < 1440 ? tostring(interval*5) : interval >= 1440 and interval*5 < 2880 ? "1D":na
  37.  
  38. src5=security(tickerid, res5, close)
  39.  
  40. fastMA5 = ema(src5, fastLength)
  41. slowMA5 = ema(src5, slowLength)
  42.  
  43. macd5 = fastMA5 - slowMA5
  44. signal5 = sma(macd5, signalLength)
  45. outMacD5 = security(tickerid, res5, macd5)
  46.  
  47. plot( outMacD5 ? outMacD5 : na, color= red)
  48.  
  49. Add to Chart operation failed, reason: Error: Cannot call `operator ?:` with arguments (bool, literal__string, na); available overloads ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement