momstrat
//@version=2 strategy("Momentum Strategy", overlay=true) length = input(1) price = close momentum(seria, length) => mom = seria - seria[length] mom mom0 = momentum(price, length) mom1 = momentum( mom0, 1) 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)