Professional Documents
Culture Documents
Strategy
Strategy
good = ta.sma(close, 20) > ta.sma(close, 50) and ta.sma(close, 50) > ta.sma(close,
200)
candle = close [2] > ta.sma (close, 20) and close [1] < ta.sma(close, 20) and
close [0] > ta.sma(close, 20)
candells = close [3] > ta.sma (close, 20) and close [2] < ta.sma(close, 20) and
close [1] < ta.sma(close, 20) and close [0] > ta.sma(close, 20)
candellls = close [4] > ta.sma (close, 20) and close [3] < ta.sma(close, 20) and
close [2] < ta.sma(close, 20) and close [1] < ta.sma(close, 20) and close [0] >
ta.sma(close, 20)
if (enter)
strategy.entry("MomLE", strategy.long, stop=high+syminfo.mintick,
comment="MomLE")
if (close < ta.sma (close, 20) or close < ta.sma (close, 50))
strategy.exit("MomLE", "MomLE", profit = close ,loss = close * 0.012 /
syminfo.mintick, comment="exit")