Advertisement
rdusnr

Untitled

Sep 11th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. // SRSYS EMA Golden/Death Cross Indicator
  2.  
  3. study(title="SRSYS EMA-Crossing", shorttitle="EMA-Crossing", overlay=true)
  4. fastEmaPeriod = input(1, minval=1, title="Fast EMA Periods")
  5. slowEmaPeriod = input(1, minval=1, title="Slow EMA Periods")
  6. srcsmoothallin = input(2, minval=0, title="Smooth whole source")
  7. smoothFast = input(4, minval=0, title="Smooth the price Fast")
  8. smoothSlow = input(5, minval=0, title="Smooth the price Slow")
  9. off = input(1, minval=0, title="Ema Visual Offset")
  10. showCrosses = input(true, title="Show EMA Crosses?")
  11. // rsiLEN = input(10,title="RSI LEN")
  12. // rsiup = input(58,title="RSI UP")
  13. // rsidn = input(50,title="RSI DN")
  14.  
  15. // rsiLEN = '3'
  16. // rsiup = '45'
  17. // rsidn = '3'
  18.  
  19. src = input(type=source,defval=close)
  20. srcsmoothall = ema(src,srcsmoothallin)
  21. srcsmoothFast = ema(srcsmoothall,smoothFast)
  22. srcsmoothSlow = ema(srcsmoothall,smoothSlow)
  23.  
  24. fastEma = ema(srcsmoothFast, fastEmaPeriod)
  25. slowEma = ema(srcsmoothSlow, slowEmaPeriod)
  26. // xRSI = rsi(srcsmoothall,rsiLEN)
  27. //xRSI = rsi(close,rsiLEN)
  28.  
  29.  
  30. plot(fastEma, title = 'Fast EMA', linewidth=1, color=lime,offset=off)
  31. plot(slowEma, title = 'Slow EMA', linewidth=1, color=fuchsia,offset=off)
  32.  
  33. goldenCross = crossover(fastEma, slowEma)
  34. deathCross = crossover(slowEma, fastEma)
  35.  
  36. plotarrow(showCrosses and goldenCross ? goldenCross : na, title="Golden Cross", colorup=green, maxheight=50, minheight=50, transp=0)
  37. plotarrow(showCrosses and deathCross*-1 ? deathCross*-1 : na, title="Death Cross", colordown=red, maxheight=50, minheight=50, transp=0)
  38.  
  39. // plotarrow(showCrosses and goldenCross and xRSI < rsidn ? goldenCross : na, title="Golden Cross", colorup=green, maxheight=50, minheight=50, transp=0)
  40. // plotarrow(showCrosses and deathCross*-1 and xRSI > rsiup ? deathCross*-1 : na, title="Death Cross", colordown=red, maxheight=50, minheight=50, transp=0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement