
Strategi ini adalah sistem perdagangan kuantitatif yang menggabungkan persilangan rata-rata, penapis RSI dan stop loss dinamik berasaskan ATR. Strategi ini mengesahkan titik peralihan trend melalui persilangan purata bergerak indeks yang cepat dan perlahan (EMA), sambil memperkenalkan indeks yang agak kuat (RSI) sebagai penapis, untuk mengelakkan perdagangan di kawasan pembelian atau penjualan yang berlebihan.
Logik teras strategi adalah berdasarkan komponen utama berikut:
Strategi ini membina sistem perdagangan yang lengkap dengan mengenal pasti trend sistem linear, penapis isyarat palsu RSI, risiko pengurusan dinamik ATR. Ciri utama strategi ini adalah beradaptasi dan dapat menyesuaikan parameter perdagangan mengikut turun naik pasaran. Melalui pelaksanaan arah pengoptimuman, kestabilan dan keuntungan strategi dapat ditingkatkan lagi.
//@version=6
strategy("High Win Rate Dogecoin Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// Input Parameters
fastLength = input(9, title="Fast EMA Length")
slowLength = input(21, title="Slow EMA Length")
atrLength = input(14, title="ATR Length")
atrMultiplier = input(2.5, title="ATR Multiplier")
rsiLength = input(14, title="RSI Length")
rsiOverbought = input(70, title="RSI Overbought")
rsiOversold = input(30, title="RSI Oversold")
// Indicators
fastEMA = ta.ema(close, fastLength)
slowEMA = ta.ema(close, slowLength)
atr = ta.atr(atrLength)
rsi = ta.rsi(close, rsiLength)
// Entry Conditions
longCondition = ta.crossover(fastEMA, slowEMA) and rsi > rsiOversold
shortCondition = ta.crossunder(fastEMA, slowEMA) and rsi < rsiOverbought
// Stop Loss & Take Profit
longStopLoss = close - (atr * atrMultiplier)
longTakeProfit = close + (atr * atrMultiplier * 2)
shortStopLoss = close + (atr * atrMultiplier)
shortTakeProfit = close - (atr * atrMultiplier * 2)
// Strategy Entries
if longCondition
strategy.entry("Long", strategy.long)
strategy.exit("TakeProfitLong", from_entry="Long", limit=longTakeProfit, stop=longStopLoss)
if shortCondition
strategy.entry("Short", strategy.short)
strategy.exit("TakeProfitShort", from_entry="Short", limit=shortTakeProfit, stop=shortStopLoss)
// Plot Signals
plotshape(series=longCondition, location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Signal")
plotshape(series=shortCondition, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Signal")
// Plot EMAs for visualization
plot(fastEMA, color=color.blue, title="Fast EMA")
plot(slowEMA, color=color.orange, title="Slow EMA")