Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. //@version=3
  2. strategy("New Strategy", overlay=true)
  3.  
  4. Length_tema = input(26, minval=1)
  5. xPrice = close
  6. xEMA1 = ema(xPrice, Length_tema)
  7. xEMA2 = ema(xEMA1, Length_tema)
  8. xEMA3 = ema(xEMA2, Length_tema)
  9. tema = 3 * xEMA1 - 3 * xEMA2 + xEMA3
  10. plot(tema, color=aqua, title="TEMA1")
  11.  
  12. length_hma = input(50, minval=1)
  13. src = input(close, title="Source")
  14. hullma = wma(2*wma(src, length_hma/2)-wma(src, length_hma), round(sqrt(length_hma)))
  15. plot(hullma, color=orange, linewidth=2)
  16.  
  17. buy = crossover(tema, hullma)
  18. sell = crossunder(tema, hullma)
  19.  
  20. if buy
  21. strategy.entry("Long", strategy.long)
  22.  
  23. if sell
  24. strategy.entry("Short", strategy.short)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement