Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.95 KB | None | 0 0
  1. //@version=3
  2. study(title='E', overlay=true)
  3.  
  4. labels = input(true, title='LABELS')
  5. crosses = input(false, title='CROSSES')
  6. gdcross = input(true, title='G&D CROSS')
  7. dailies = input(false, title='DAILY EMAS')
  8. hideo = input(false, title='HIDE OTHERS')
  9.  
  10. sma10 = sma(close, 10)
  11. plot(hideo == false ? sma10:na, color=red, transp=0, linewidth=1, title='10')
  12. ema21 = ema(close, 21)
  13. plot(hideo == false ? ema21:na, color=yellow, transp=0, linewidth=2, title='21')
  14. ema50 = ema(close, 50)
  15. plot(hideo == false ? ema50:na, color=lime, transp=0, linewidth=2, title='50')
  16. ema89 = ema(close, 89)
  17. plot(hideo == false ? ema89:na, color=#e91e63, transp=0, linewidth=2, title='89')
  18. ema100 = ema(close, 100)
  19. plot(hideo == false ? ema100:na, color=aqua, transp=0, linewidth=2, title='100')
  20. ema144 = ema(close, 144)
  21. plot(hideo == false ? ema144:na, color=#512da8, transp=0, linewidth=2, title='144')
  22. ema200 = ema(close, 200)
  23. plot(hideo == false ? ema200:na, color=fuchsia, transp=0, linewidth=2, title='200')
  24. sma200 = sma(close, 200)
  25. plot(hideo == false ? sma200:na, color=red, transp=0, linewidth=2, title='200')
  26. ema377 = ema(close, 377)
  27. plot(hideo == false ? ema377:na, color=maroon, transp=0, linewidth=2, title='377')
  28. ema886 = ema(close, 886)
  29. plot(hideo == false ? ema886:na, color=white, transp=0, linewidth=2, title='886')
  30.  
  31. sma10_1d = security(tickerid, 'D', sma10)
  32. plot(dailies == true ? sma10_1d:na, color=red, transp=0, linewidth=1, title='10 D')
  33. ema21_1d = security(tickerid, 'D', ema21)
  34. plot(dailies == true ? ema21_1d:na, color=yellow, transp=0, linewidth=2, title='21 D')
  35. ema50_1d = security(tickerid, 'D', ema50)
  36. plot(dailies == true ? ema50_1d:na, color=lime, transp=0, linewidth=2, title='50 D')
  37. ema89_1d = security(tickerid, 'D', ema89)
  38. plot(dailies == true ? ema89_1d:na, color=#e91e63, transp=0, linewidth=2, title='89 D')
  39. ema100_1d = security(tickerid, 'D', ema100)
  40. plot(dailies == true ? ema100_1d:na, color=aqua, transp=0, linewidth=2, title='100 D')
  41. ema144_1d = security(tickerid, 'D', ema144)
  42. plot(dailies == true ? ema144_1d:na, color=#512da8, transp=0, linewidth=2, title='144 D')
  43. ema200_1d = security(tickerid, 'D', ema200)
  44. plot(dailies == true ? ema200_1d:na, color=fuchsia, transp=0, linewidth=2, title='200 D')
  45. sma200_1d = security(tickerid, 'D', sma200)
  46. plot(dailies == true ? sma200_1d:na, color=red, transp=0, linewidth=2, title='200 D')
  47. ema377_1d = security(tickerid, 'D', ema377)
  48. plot(dailies == true ? ema377_1d:na, color=maroon, transp=0, linewidth=2, title='377 D')
  49. ema886_1d = security(tickerid, 'D', ema886)
  50. plot(dailies == true ? ema886_1d:na, color=white, transp=0, linewidth=2, title='886 D')
  51.  
  52. sma10_cu = crossunder(close, sma10)
  53. sma10_co = crossover(close, sma10)
  54. plotshape(hideo == false and crosses == true ? sma10_cu:na, style=shape.xcross, location=location.belowbar, show_last=1, color=red, transp=0, title='10', size=size.tiny)
  55. plotshape(hideo == false and crosses == true ? sma10_co:na, style=shape.xcross, location=location.abovebar, show_last=1, color=red, transp=0, title='10', size=size.tiny)
  56. plotshape(hideo == false and labels == true ? sma10:na, style=shape.diamond, location=location.absolute, show_last=1, color=red, transp=0, text='10', title='10', offset=4)
  57.  
  58. ema21_cu = crossunder(close, ema21)
  59. ema21_co = crossover(close, ema21)
  60. plotshape(hideo == false and crosses == true ? ema21_cu:na, style=shape.xcross, location=location.belowbar, show_last=1, color=yellow, transp=0, title='21', size=size.tiny)
  61. plotshape(hideo == false and crosses == true ? ema21_co:na, style=shape.xcross, location=location.abovebar, show_last=1, color=yellow, transp=0, title='21', size=size.tiny)
  62. plotshape(hideo == false and labels == true ? ema21:na, style=shape.diamond, location=location.absolute, show_last=1, color=yellow, transp=0, text='21', title='21', offset=4)
  63.  
  64. ema50_cu = crossunder(close, ema50)
  65. ema50_co = crossover(close, ema50)
  66. plotshape(hideo == false and crosses == true ? ema50_cu:na, style=shape.xcross, location=location.belowbar, show_last=1, color=lime, transp=0, title='50', size=size.tiny)
  67. plotshape(hideo == false and crosses == true ? ema50_co:na, style=shape.xcross, location=location.abovebar, show_last=1, color=lime, transp=0, title='50', size=size.tiny)
  68. plotshape(hideo == false and labels == true ? ema50:na, style=shape.diamond, location=location.absolute, show_last=1, color=lime, transp=0, text='50', title='50', offset=4)
  69.  
  70. ema89_cu = crossunder(close, ema89)
  71. ema89_co = crossover(close, ema89)
  72. plotshape(hideo == false and crosses == true ? ema89_cu:na, style=shape.xcross, location=location.belowbar, show_last=1, color=#e91e63, transp=0, title='89', size=size.tiny)
  73. plotshape(hideo == false and crosses == true ? ema89_co:na, style=shape.xcross, location=location.abovebar, show_last=1, color=#e91e63, transp=0, title='89', size=size.tiny)
  74. plotshape(hideo == false and labels == true ? ema89:na, style=shape.diamond, location=location.absolute, show_last=1, color=#e91e63, transp=0, text='89', title='89', offset=4)
  75.  
  76. ema100_cu = crossunder(close, ema100)
  77. ema100_co = crossover(close, ema100)
  78. plotshape(hideo == false and crosses == true ? ema100_cu:na, style=shape.xcross, location=location.belowbar, show_last=1, color=aqua, transp=0, title='100', size=size.tiny)
  79. plotshape(hideo == false and crosses == true ? ema100_co:na, style=shape.xcross, location=location.abovebar, show_last=1, color=aqua, transp=0, title='100', size=size.tiny)
  80. plotshape(hideo == false and labels == true ? ema100:na, style=shape.diamond, location=location.absolute, show_last=1, color=aqua, transp=0, text='100', title='100', offset=4)
  81.  
  82. ema144_cu = crossunder(close, ema144)
  83. ema144_co = crossover(close, ema144)
  84. plotshape(hideo == false and crosses == true ? ema144_cu:na, style=shape.xcross, location=location.belowbar, show_last=1, color=#512da8, transp=0, title='144', size=size.tiny)
  85. plotshape(hideo == false and crosses == true ? ema144_co:na, style=shape.xcross, location=location.abovebar, show_last=1, color=#512da8, transp=0, title='144', size=size.tiny)
  86. plotshape(hideo == false and labels == true ? ema144:na, style=shape.diamond, location=location.absolute, show_last=1, color=#512da8, transp=0, text='144', title='144', offset=4)
  87.  
  88. ema200_cu = crossunder(close, ema200)
  89. ema200_co = crossover(close, ema200)
  90. plotshape(hideo == false and crosses == true ? ema200_cu:na, style=shape.xcross, location=location.belowbar, show_last=1, color=fuchsia, transp=0, title='200', size=size.tiny)
  91. plotshape(hideo == false and crosses == true ? ema200_co:na, style=shape.xcross, location=location.abovebar, show_last=1, color=fuchsia, transp=0, title='200', size=size.tiny)
  92. plotshape(hideo == false and labels == true ? ema200:na, style=shape.diamond, location=location.absolute, show_last=1, color=fuchsia, transp=0, text='200', title='200', offset=4)
  93.  
  94. sma200_cu = crossunder(close, sma200)
  95. sma200_co = crossover(close, sma200)
  96. plotshape(hideo == false and crosses == true ? sma200_cu:na, style=shape.xcross, location=location.belowbar, show_last=1, color=red, transp=0, title='200', size=size.tiny)
  97. plotshape(hideo == false and crosses == true ? sma200_co:na, style=shape.xcross, location=location.abovebar, show_last=1, color=red, transp=0, title='200', size=size.tiny)
  98. plotshape(hideo == false and labels == true ? sma200:na, style=shape.diamond, location=location.absolute, show_last=1, color=red, transp=0, text='200', title='200', offset=4)
  99.  
  100. ema377_cu = crossunder(close, ema377)
  101. ema377_co = crossover(close, ema377)
  102. plotshape(hideo == false and crosses == true ? ema377_cu:na, style=shape.xcross, location=location.belowbar, show_last=1, color=maroon, transp=0, title='377', size=size.tiny)
  103. plotshape(hideo == false and crosses == true ? ema377_co:na, style=shape.xcross, location=location.abovebar, show_last=1, color=maroon, transp=0, title='377', size=size.tiny)
  104. plotshape(hideo == false and labels == true ? ema377:na, style=shape.diamond, location=location.absolute, show_last=1, color=maroon, transp=0, text='377', title='377', offset=4)
  105.  
  106. ema886_cu = crossunder(close, ema886)
  107. ema886_co = crossover(close, ema886)
  108. plotshape(hideo == false and crosses == true ? ema886_cu:na, style=shape.xcross, location=location.belowbar, show_last=1, color=white, transp=0, title='886', size=size.tiny)
  109. plotshape(hideo == false and crosses == true ? ema886_co:na, style=shape.xcross, location=location.abovebar, show_last=1, color=white, transp=0, title='886', size=size.tiny)
  110. plotshape(hideo == false and labels == true ? ema886:na, style=shape.diamond, location=location.absolute, show_last=1, color=white, transp=0, text='886', title='886', offset=4)
  111.  
  112. plotshape(dailies == true and labels == true ? sma10_1d:na, style=shape.diamond, location=location.absolute, show_last=1, color=red, transp=0, text='10 D', title='10 D', offset=8)
  113. plotshape(dailies == true and labels == true ? ema21_1d:na, style=shape.diamond, location=location.absolute, show_last=1, color=yellow, transp=0, text='21 D', title='21 D', offset=8)
  114. plotshape(dailies == true and labels == true ? ema50_1d:na, style=shape.diamond, location=location.absolute, show_last=1, color=lime, transp=0, text='50 D', title='50 D', offset=8)
  115. plotshape(dailies == true and labels == true ? ema89_1d:na, style=shape.diamond, location=location.absolute, show_last=1, color=#e91e63, transp=0, text='89 D', title='89 D', offset=8)
  116. plotshape(dailies == true and labels == true ? ema100_1d:na, style=shape.diamond, location=location.absolute, show_last=1, color=aqua, transp=0, text='100 D', title='100 D', offset=8)
  117. plotshape(dailies == true and labels == true ? ema144_1d:na, style=shape.diamond, location=location.absolute, show_last=1, color=#512da8, transp=0, text='144 D', title='144 D', offset=8)
  118. plotshape(dailies == true and labels == true ? ema200_1d:na, style=shape.diamond, location=location.absolute, show_last=1, color=fuchsia, transp=0, text='200 D', title='200 D', offset=8)
  119. plotshape(dailies == true and labels == true ? sma200_1d:na, style=shape.diamond, location=location.absolute, show_last=1, color=red, transp=0, text='200 D', title='200 D', offset=8)
  120. plotshape(dailies == true and labels == true ? ema377_1d:na, style=shape.diamond, location=location.absolute, show_last=1, color=maroon, transp=0, text='377 D', title='377 D', offset=8)
  121. plotshape(dailies == true and labels == true ? ema886_1d:na, style=shape.diamond, location=location.absolute, show_last=1, color=white, transp=0, text='886 D', title='886 D', offset=8)
  122.  
  123. goldenx_1d = crossover(ema50_1d, ema200_1d) and not isweekly and not ismonthly
  124. alertcondition(goldenx_1d, title='1D GOLDEN X', message='1D GOLDEN X')
  125. plotshape(gdcross == true ? goldenx_1d:na, style=shape.xcross, location=location.belowbar, color=yellow, transp=0, text='1D GOLDEN', title='1D GOLDEN X', show_last=100, size=size.huge)
  126. deathx_1d = crossunder(ema50_1d, ema200_1d) and not isweekly and not ismonthly
  127. alertcondition(deathx_1d, title='1D DEATH X', message='1D DEATH X')
  128. plotshape(gdcross == true ? deathx_1d:na, style=shape.xcross, location=location.abovebar, color=red, transp=0, text='1D DEATH', title='1D DEATH X', show_last=100, size=size.huge)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement