//single RSI=ta.rsi(close,14) BUY=sma12>sma16 and sma12>sma20 and sma12>sma24 and sma16>sma20 and sma16>sma24 and ta.rising(close,2) and RSI<65 SELL=sma12<sma16 and sma12<sma20 and sma12<sma24 and sma16<sma20 and sma16<sma24 and ta.falling(close,2) and RSI>31
if not strategy.opentrades // Long Strategy if BUY strategy.entry("Long", strategy.long) strategy.exit("exit", "Long", stop=stop_long, trail_points=trail_points, trail_offset=trail_offset)
// Short Strategy if SELL strategy.entry("Short", strategy.short) strategy.exit("exit","Short", stop=stop_short, trail_points=trail_points, trail_offset=trail_offset)
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.