Advertisement
lonjan

Untitled

Jun 5th, 2021
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
  2. //@version=4
  3.  
  4. study("EMA9+MA20+MA50", overlay=true)
  5. //Selection box//
  6. ema2 = input(title="EMA 9", type=input.bool, defval=true)
  7. sma1 = input(title="SMA 20", type=input.bool, defval=true)
  8. sma2 = input(title="SMA 50", type=input.bool, defval=true)
  9. //sma3 = input(title="SMA 200", type=input.bool, defval=true)
  10.  
  11.  
  12. //Parameters//
  13. ema9 = ema(close, 9)
  14. //ema10 = ema(close,10)
  15. sma20 = sma(close,20)
  16. sma50 = sma(close,50)
  17. //sma200 = sma(close,200)
  18.  
  19. //Plotting lines//
  20. plot(ema9 ? ema9 : na, title="EMA 9", color = color.new(#05b3fb, transp = 0), linewidth=2)
  21. plot(sma1 ? sma20 : na, title="SMA 20", color = color.new(#9c32a6, transp = 0), linewidth=2)
  22. plot(sma2 ? sma50 : na, title="SMA 50", color = color.new(#000000, transp = 0), linewidth=2)
  23. //plot(sma2 ? sma200 : na, title="SMA 200", color=#000000, transp=0, linewidth=2)
  24.  
  25.  
  26.  
  27. //Crossover Signal//
  28. plotshape(crossover(ema9, sma20), style=shape.arrowup, color=#000000, text="BC1", textcolor=#000000, location=location.belowbar, title="SHORT TERM BUY SIGNAL")
  29. plotshape(crossover(sma20, sma50), style=shape.arrowup, color=#000000, text="BC2", textcolor=#000000, location=location.belowbar, title="MID TERM BUY SIGNAL")
  30. //plotshape(crossover(sma50, sma200), style=shape.arrowup, color=#dbff05, text="Buy", textcolor=#000000, location=location.belowbar, title="LONG TERM BUY SIGNAL")
  31.  
  32.  
  33. plotshape(crossover(sma20,ema9), style=shape.arrowdown, color=#a63232, text="DC1", textcolor=#a63232, location=location.abovebar, title="SHORT TERM BUY SIGNAL")
  34. plotshape(crossover(sma50, sma20), style=shape.arrowdown, color=#a63232, text="DC2", textcolor=#a63232, location=location.abovebar, title="MID TERM BUY SIGNAL")
  35. //plotshape(crossover(sma50, sma200), style=shape.arrowup, color=#dbff05, text="Buy", textcolor=#000000, location=location.belowbar, title="LONG TERM BUY SIGNAL")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement