Advertisement
Guest User

Untitled

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