//version=5
strategy("COTI 4H Swing Strategy - MA & RSI", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// Input MA dan RSI
maShort = ta.sma(close, 7)
maMid = ta.sma(close, 25)
maLong = ta.sma(close, 99)
rsi = ta.rsi(close, 14)
rsiShort = ta.rsi(close, 6)
// Entry Buy: Harga dekat MA99 dan RSI mendekati oversold
buyCondition = close > maLong and close < maMid and rsi < 45 and ta.crossover(rsiShort, rsi)
if (buyCondition)
strategy.entry("Buy", strategy.long)
// Exit: Take profit saat harga mendekati MA25 atau RSI overbought
takeProfit = close > maMid and rsi > 65
if (takeProfit)
strategy.close("Buy")
// Stop Loss: Jika harga turun di bawah MA99
stopLoss = close < maLong * 0.98
if (stopLoss)
strategy.close("Buy")
// Plot MA
plot(maShort, color=color.yellow, title="MA 7")
plot(maMid, color=color.red, title="MA 25")
plot(maLong, color=color.purple, title="MA 99")
strategy("COTI 4H Swing Strategy - MA & RSI", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// Input MA dan RSI
maShort = ta.sma(close, 7)
maMid = ta.sma(close, 25)
maLong = ta.sma(close, 99)
rsi = ta.rsi(close, 14)
rsiShort = ta.rsi(close, 6)
// Entry Buy: Harga dekat MA99 dan RSI mendekati oversold
buyCondition = close > maLong and close < maMid and rsi < 45 and ta.crossover(rsiShort, rsi)
if (buyCondition)
strategy.entry("Buy", strategy.long)
// Exit: Take profit saat harga mendekati MA25 atau RSI overbought
takeProfit = close > maMid and rsi > 65
if (takeProfit)
strategy.close("Buy")
// Stop Loss: Jika harga turun di bawah MA99
stopLoss = close < maLong * 0.98
if (stopLoss)
strategy.close("Buy")
// Plot MA
plot(maShort, color=color.yellow, title="MA 7")
plot(maMid, color=color.red, title="MA 25")
plot(maLong, color=color.purple, title="MA 99")
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
