瑞士法郎 / 日圓

Coti

56
//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")

免責聲明

這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。