Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. //@version=4
  2. study("My Script", overlay=true)
  3.  
  4. ema1=ema(close, 100)
  5. plot(ema1)
  6.  
  7. ema2=ema(close, 50)
  8. plot(ema2, color=color.red)
  9.  
  10. enter=crossover(close, ema1)
  11. plotshape(enter, style=shape.triangleup,size=size.small, color=color.lime, location=location.belowbar, text="enter")
  12.  
  13. exit=crossover(ema2, ema1)
  14. plotshape(exit, style=shape.diamond,size=size.small, color=color.yellow, location=location.abovebar, text="exit")
  15.  
  16.  
  17. aaa=barssince(enter)
  18. plot(aaa)
  19.  
  20. bbb=barssince(exit)
  21. plot(bbb)
  22.  
  23. long=aaa>bbb
  24.  
  25. qqq=valuewhen(long,close,0)
  26. col=qqq==qqq[1]?color.yellow:na
  27. plot(qqq, color=col)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement