Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=3
- strategy("New Strategy", overlay=true)
- Length_tema = input(26, minval=1)
- xPrice = close
- xEMA1 = ema(xPrice, Length_tema)
- xEMA2 = ema(xEMA1, Length_tema)
- xEMA3 = ema(xEMA2, Length_tema)
- tema = 3 * xEMA1 - 3 * xEMA2 + xEMA3
- plot(tema, color=aqua, title="TEMA1")
- length_hma = input(50, minval=1)
- src = input(close, title="Source")
- hullma = wma(2*wma(src, length_hma/2)-wma(src, length_hma), round(sqrt(length_hma)))
- plot(hullma, color=orange, linewidth=2)
- buy = crossover(tema, hullma)
- sell = crossunder(tema, hullma)
- if buy
- strategy.entry("Long", strategy.long)
- if sell
- strategy.entry("Short", strategy.short)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement