Advertisement
test2222

MS

Jun 17th, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. study(title="Magic Scalper - Long / Short", shorttitle="Magic Scalper", overlay=true)
  2. len = input(20, minval=1, title="Length")
  3. src = input(close, title="Source")
  4. out = ema(src, len)
  5. //plot(out, title="EMA", color=blue)
  6. last8h = highest(close, 8)
  7. lastl8 = lowest(close, 8)
  8.  
  9. //plot(last8h, color=red, linewidth=2)
  10. //plot(lastl8, color=green, linewidth=2)
  11.  
  12.  
  13. bearish = cross(close,out) == 1 and close[1] > close
  14. bullish = cross(close,out) == 1 and close[1] < close
  15.  
  16. plotshape(bearish, color=red, style=shape.arrowdown, text="Short", location=location.abovebar)
  17. plotshape(bullish, color=green, style=shape.arrowup, text="Long", location=location.belowbar)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement