BHARTI AIRTEL LTD

20 day momentum

202
//version=3
strategy("Momentum Strategy", overlay=true)
length = input(12)
price = close

momentum(seria, length) =>
mom = seria - seria[length]
mom

mom0 = momentum(price, length)
mom1 = momentum( mom0, 20)

if (mom0 > 0 and mom1 > 0)
strategy.entry("MomLE", strategy.long, stop=high+syminfo.mintick, comment="MomLE")
else
strategy.cancel("MomLE")

if (mom0 < 0 and mom1 < 0)
strategy.entry("MomSE", strategy.short, stop=low-syminfo.mintick, comment="MomSE")
else
strategy.cancel("MomSE")

//plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.