Guest User

Not MCA 1

a guest
Aug 6th, 2020
2,524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.81 KB | None | 0 0
  1. //@version=3
  2. study(title="NotMCA EMA/SMA Divergencess", shorttitle="MA", overlay=true, linktoseries=true)
  3.  
  4. //Blood diamonds and yellow x's
  5. // PARAMETERS {
  6.  
  7. // WaveTrend Overbought & Oversold lines
  8. obLevel = input(53, "WT Overbought Level 1")
  9. obLevel2 = input(60, "WT Overbought Level 2")
  10. osLevel = input(-53, "WT Oversold Level 1")
  11. osLevel2 = input(-60, "WT Oversold Level 2")
  12.  
  13. //EMA Ribbon
  14. showRibbon = input(false, "Show Ribbon")
  15.  
  16. ema1 = input(5)
  17. ema2 = input(11)
  18. ema3 = input(15)
  19. ema4 = input(18)
  20. ema5 = input(21)
  21. ema6 = input(25)
  22. ema7 = input(29)
  23. ema8 = input(33)
  24. ema9 = input(200)
  25. ema10 = input(10)
  26. // }
  27.  
  28.  
  29. // CALCULATE INDICATORS {
  30.  
  31. //EMA Ribbon
  32. ema1_ = ema(close, ema1)
  33. ema2_ = ema(close, ema2)
  34. ema3_ = ema(close, ema3)
  35. ema4_ = ema(close, ema4)
  36. ema5_ = ema(close, ema5)
  37. ema6_ = ema(close, ema6)
  38. ema7_ = ema(close, ema7)
  39. ema8_ = ema(close, ema8)
  40.  
  41. // RSI
  42. up = rma(max(change(close), 0), 14)
  43. down = rma(-min(change(close), 0), 14)
  44. rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - 100 / (1 + up / down)
  45.  
  46. // WT
  47. n1 = input(7, "WT Channel Length")
  48. n2 = input(12, "WT Average Length")
  49.  
  50. ap = input(ohlc4)
  51. esa = ema(ap, n1)
  52. de = ema(abs(ap - esa), n1)
  53. ci = (ap - esa) / (0.015 * de)
  54. tci = ema(ci, n2)
  55. wt1 = tci
  56. wt2 = sma(wt1, 3)
  57.  
  58. vwap_area = wt1 - wt2
  59.  
  60. // WaveTrend Conditions
  61. WTCross = cross(wt1, wt2)
  62. WTCrossUp = wt2 - wt1 <= 0
  63. WTCrossDown = wt2 - wt1 >= 0
  64. WTOverSold = wt2 <= osLevel2
  65. WTOverBought = wt2 >= obLevel2
  66.  
  67. // Signals
  68.  
  69. longEma = crossover(ema2_, ema8_)
  70. redCross = crossunder(ema1_, ema2_)
  71. blueTriangle = crossover(ema2_, ema3_)
  72. redDiamond = WTCross and WTCrossDown
  73. yellowCross = redDiamond and rsi <= 30 and wt2 <= osLevel
  74. bloodDiamond = redDiamond and redCross
  75. shortEma = crossover(ema8_, ema2_)
  76.  
  77.  
  78.  
  79. // } CALCULATE INDICATORS
  80.  
  81. // DRAW {
  82.  
  83. // SHAPES
  84. plotshape(longEma, style=shape.circle, color=#00ff00, transp=50, location=location.abovebar, size=size.tiny, title="Long EMA Signal")
  85. plotshape(shortEma, style=shape.circle, color=#ff0000, transp=50, location=location.abovebar, size=size.tiny, title="Short EMA Signal")
  86. plotshape(redCross, style=shape.xcross, color=#ff0000, transp=50, location=location.abovebar, size=size.tiny, title="Red cross")
  87. plotshape(blueTriangle, style=shape.triangleup, color=#0064ff, transp=50, location=location.abovebar, size=size.small, title="Blue Triangle")
  88. plotshape(redDiamond, style=shape.diamond, color=#ff0000, location=location.abovebar, size=size.tiny, title="Red Diamond", transp=25)
  89. plotshape(bloodDiamond, style=shape.diamond, color=#ff0000, location=location.abovebar, size=size.small, title="Blood Diamond", transp=15)
  90. plotshape(yellowCross, style=shape.xcross, color=#FDFF00, location=location.abovebar, size=size.small, title="Yellow Cross", transp=25)
  91.  
  92. // } DRAW
  93.  
  94.  
  95. // ALERTS {
  96. alertcondition(redDiamond != 0, "Red Diamond", "Red Diamond")
  97. alertcondition(bloodDiamond != 0, "Blood Diamond", "Blood Diamond")
  98. alertcondition(yellowCross != 0, "YellowX", "YellowX")
  99. alertcondition(redCross != 0, "RedX", "RedX")
  100. alertcondition(longEma != 0, "Longema", "Longema")
  101. alertcondition(blueTriangle != 0, "Bluetriangle", "Bluetriangle")
  102. // } ALERTS
  103.  
  104.  
  105. plot(sma(close, 10), title="10 SMA", color=#1DE60C, linewidth=4, transp=0)
  106. plot(ema(close, 100), title="100 EMA", color=#FFF602, linewidth=4, transp=0)
  107. plot(sma(close, 200), title="200 SMA", color=#DC143C, linewidth=4, transp=0)
  108. plot(sma(close, 100), title="100 SMA", color=#1DE60C, linewidth=1, transp=0)
  109. plot(ema(close, 50), title="50 EMA", color=#E60CDA, linewidth=1, transp=0)
  110. plot(ema(close, 20), title="20 EMA", color=#FFC600, linewidth=1, transp=0)
  111. plot(ema(close, 10), title="10 EMA", color=#00FFFA, linewidth=3, transp=0)
  112. plot(ema(close, 200), title="GOLDEN ROPES 200 EMA", color=#FC9E03, linewidth=4, transp=0)
  113. plot(vwap, "VWAP", color=#FFFFFF, linewidth=4, transp=0)
Advertisement
Add Comment
Please, Sign In to add comment