Advertisement
Guest User

Untitled

a guest
Nov 17th, 2022
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. //@version=4
  2. study(title="VISHNU SIGNAL", overlay=true)
  3.  
  4. LengthSEMA = input(title="SEMA Length", defval=9)
  5. LengthLEMA = input(title="LEMA Length", defval=21)
  6. LengthSlow50MA=input(title="50 MA Length", defval=50)
  7. Length34EMA=input(title="34 MA Length", defval=34)
  8. Length50EMA=input(title="50 MA Length", defval=50)
  9.  
  10. SEMA = ema(close, LengthSEMA)
  11. LEMA = ema(close, LengthLEMA)
  12. Slow50MA = sma(close,LengthSlow50MA)
  13. slow34ema=ema(close, Length34EMA)
  14. slow50ema=ema(close, Length50EMA)
  15. //buy = crossover(SEMA, LEMA ) and close > Slow50MA
  16. // MACD
  17.  
  18. //buy = crossover(SEMA, LEMA ) and close > Slow50MA and histLine >0.1
  19. buy = crossover(SEMA, LEMA ) and close > Slow50MA and close >slow50ema
  20.  
  21. if buy
  22. alert("BUY alert on" + timeframe.period)
  23.  
  24. sell=crossover(LEMA, SEMA ) and close < Slow50MA and close < slow50ema
  25.  
  26. if sell
  27. alert("SELL alert on" + timeframe.period)
  28. ////plot(MA, color=color.new(color.green, 0), title=MA)
  29. //plot(EMA, color=color.new(color.red, 0), title=EMA)
  30.  
  31. //emadiff = LengthLEMA - slow34ema
  32.  
  33. cross = crossover(SEMA, LEMA ) or crossover(LEMA, SEMA )
  34.  
  35. if cross
  36. alert("CROSS alert on" + timeframe.period)
  37.  
  38. plotshape(cross, style=shape.labeldown, location=location.abovebar, color=color.rgb(106, 76, 175), size=size.tiny, title="Cross", text="C", textcolor=color.white)
  39.  
  40. plotshape(buy, style=shape.labelup, location=location.bottom, color=color.green, size=size.tiny, title="Buy", text="B", textcolor=color.white)
  41. plotshape(sell, style=shape.labeldown, location=location.top, color=color.red, size=size.tiny, title="Sell", text="SELL", textcolor=color.white)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement