Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
639
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. //@version=4
  2.  
  3. study(title="Market Cipher A", shorttitle="Cipher A", overlay=true)
  4. //EMA Ribbon
  5. ema1 = input(5)
  6. ema2 = input(11)
  7. ema3 = input(15)
  8. ema4 = input(18)
  9. ema5 = input(21)
  10. ema6 = input(24)
  11. ema7 = input(28)
  12. ema8 = input(34)
  13. ema1_ = ema(close, ema1)
  14. ema2_ = ema(close, ema2)
  15. ema3_ = ema(close, ema3)
  16. ema4_ = ema(close, ema4)
  17. ema5_ = ema(close, ema5)
  18. ema6_ = ema(close, ema6)
  19. ema7_ = ema(close, ema7)
  20. ema8_ = ema(close, ema8)
  21. plot(ema1_, color=#265aa6, linewidth=2, transp=50, title="EMA 1")
  22. plot(ema2_, color=#265aa6, linewidth=2, transp=50, title="EMA 2")
  23. plot(ema3_, color=#1976d2, linewidth=2, transp=50, title="EMA 3")
  24. plot(ema4_, color=#1976d2, linewidth=2, transp=50, title="EMA 4")
  25. plot(ema5_, color=#7fb3ff, linewidth=2, transp=50, title="EMA 5")
  26. plot(ema6_, color=#7fb3ff, linewidth=2, transp=50, title="EMA 6")
  27. plot(ema7_, color=#bbdefb, linewidth=2, transp=50, title="EMA 7")
  28. plot(ema8_, color=#bbdefb, linewidth=2, transp=50, title="EMA 8")
  29.  
  30. Longema = crossover(ema2_, ema8_)
  31. plotshape(Longema, style=shape.circle, color=color.green, transp=45, location=location.abovebar, size=size.tiny, title="Long EMA Signal")
  32. Redcross = crossunder(ema1_, ema2_)
  33. plotshape(Redcross, style=shape.xcross, color=color.red, transp=45, location=location.abovebar, size=size.tiny, title="Red cross")
  34. Bluetriangle = crossover(ema2_, ema3_)
  35. plotshape(Bluetriangle, style=shape.triangleup, color=#0064ff, transp=45, location=location.abovebar, size=size.small, title="Blue Triangle")
  36.  
  37. alertcondition(Redcross != 0, "RedX", "RedX")
  38. alertcondition(Longema != 0, "Longema", "Longema")
  39. alertcondition(Bluetriangle != 0, "Bluetriangle", "Bluetriangle")
  40.  
  41. n1 = input(9, "WT Channel Length")
  42. n2 = input(12, "WT Average Length")
  43.  
  44. obLevel = input(60, "WT Over Bought Level")
  45. osLevel = input(-60, "WT Over Sold Level")
  46.  
  47. yellowXLevel = -50
  48.  
  49. ap = hlc3
  50. esa = ema(ap, n1)
  51. d = ema(abs(ap - esa), n1)
  52. ci = (ap - esa) / (0.015 * d)
  53. tci = ema(ci, n2)
  54. wt1 = tci
  55. wt2 = sma(wt1, 3)
  56.  
  57. redDiamond = cross(wt1, wt2) and wt2 - wt1 > 0
  58. plotshape(redDiamond, style=shape.diamond, color=color.red, location=location.abovebar, size=size.tiny, title="Red Diamond", transp=25)
  59. bloodDiamond = cross(wt1, wt2) and wt2 - wt1 > 0 and Redcross
  60. plotshape(bloodDiamond, style=shape.diamond, color=color.red, location=location.abovebar, size=size.small, title="Blood Diamond", transp=25)
  61. yellowCross = cross(wt1, wt2) and wt2 - wt1 > 0 and wt2 < yellowXLevel
  62. plotshape(yellowCross, style=shape.xcross, color=color.yellow, location=location.abovebar, size=size.small, title="Yellow Cross", transp=25)
  63.  
  64. alertcondition(redDiamond != 0, "Red Diamond", "Red Diamond")
  65. alertcondition(bloodDiamond != 0, "Blood Diamond", "Blood Diamond")
  66. alertcondition(yellowCross != 0, "YellowX", "YellowX")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement