
이 전략은 다중 시간 프레임 분석을 결합한 트렌드 추적 거래 시스템으로, 지수 이동 평균 ((EMA), 평균 트렌드 지수 ((ADX) 및 상대적으로 강한 지수 ((RSI) 와 같은 여러 기술 지표를 통합하여 15 분 시간 프레임에 거래합니다. 전략은 보수적인 포지션 관리 방법을 사용하며, 각 거래의 위험은 계좌 총액의 2% 이내에 제어되어 장기적으로 안정적인 수익을 얻습니다.
전략은 빠른 EMA ((50주기) 와 느린 EMA ((200주기) 의 교차를 사용하여 트렌드 방향을 식별하고, ADX 지표와 결합하여 트렌드 강도를 확인한다. ADX 값이 25보다 크면 시장이 강한 트렌드 상태에 있음을 나타냅니다. RSI 지표는 RSI 값이 70에 도달하면 평소 상위, RSI 값이 30에 도달하면 평소 공백을 식별하는 오버 바이 오버 판매 상태를 식별하는 데 사용됩니다.
이 전략은 다차원적인 기술 분석 방법과 엄격한 위험 통제를 통해 좋은 거래 잠재력을 보여준다. 재검토에서 안정적인 성능을 보이지만, 실제 환경에서 충분히 검증해야 한다. 전략의 모듈화 설계는 강력한 적응력과 최적화 공간을 제공하며 시장 변화에 따라 유연하게 조정할 수 있다.
/*backtest
start: 2024-02-20 00:00:00
end: 2025-02-18 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"DOGE_USDT"}]
*/
//@version=5
strategy("DOGE Enhanced Trend Following Strategy",
overlay=true,
default_qty_type=strategy.percent_of_equity,
default_qty_value=5,
commission_value=0.1,
slippage=2)
// === INPUT PARAMETERS ===
emaFastLength = input(50, title="Fast EMA Length")
emaSlowLength = input(200, title="Slow EMA Length")
adxLength = input.int(14, title="ADX Length")
adxSmoothing = input.int(14, title="ADX Smoothing Factor")
adxThreshold = input.float(25, title="ADX Trend Strength Threshold")
rsiLength = input.int(14, title="RSI Length")
rsiOverbought = input.float(70, title="RSI Overbought Level")
rsiOversold = input.float(30, title="RSI Oversold Level")
takeProfitMultiplier = input.float(1.03, title="Take Profit Multiplier", tooltip="Set a dynamic take profit level, e.g., 1.03 = 3% profit")
stopLossMultiplier = input.float(0.97, title="Stop Loss Multiplier", tooltip="Set stop loss level, e.g., 0.97 = 3% below entry price")
// === INDICATOR CALCULATIONS ===
emaFast = ta.ema(close, emaFastLength)
emaSlow = ta.ema(close, emaSlowLength)
[dip, dim, adxValue] = ta.dmi(adxLength, adxSmoothing)
rsiValue = ta.rsi(close, rsiLength)
// === MULTI-TIMEFRAME CONFIRMATION ===
emaFastHTF = request.security(syminfo.tickerid, "240", ta.ema(close, emaFastLength))
emaSlowHTF = request.security(syminfo.tickerid, "240", ta.ema(close, emaSlowLength))
// === CONDITIONS FOR TRADE ENTRY ===
bullishTrend = ta.crossover(emaFast, emaSlow) and adxValue > adxThreshold and rsiValue > rsiOversold
bearishTrend = ta.crossunder(emaFast, emaSlow) and adxValue > adxThreshold and rsiValue < rsiOverbought
// === TRADE EXECUTION ===
if (bullishTrend)
strategy.entry("Long", strategy.long)
strategy.exit("TakeProfit_Long", from_entry="Long", limit=close * takeProfitMultiplier, stop=close * stopLossMultiplier)
if (bearishTrend)
strategy.entry("Short", strategy.short)
strategy.exit("TakeProfit_Short", from_entry="Short", limit=close * (2 - takeProfitMultiplier), stop=close * (2 - stopLossMultiplier))
// === VISUAL INDICATORS AND PLOTTING ===
plot(emaFast, color=color.blue, linewidth=2, title="Fast EMA")
plot(emaSlow, color=color.red, linewidth=2, title="Slow EMA")
hline(adxThreshold, "ADX Threshold", color=color.gray, linestyle=hline.style_dotted)
bgcolor(bullishTrend ? color.new(color.green, 85) : bearishTrend ? color.new(color.red, 85) : na)
// === ALERTS ===
alertcondition(bullishTrend, title="Buy Signal", message="Bullish trend detected. Consider entering a long position.")
alertcondition(bearishTrend, title="Sell Signal", message="Bearish trend detected. Consider entering a short position.")
// === STRATEGY SETTINGS FOR REALISTIC TESTING ===
strategy.close("Long", when=rsiValue > rsiOverbought, comment="Exit Long on RSI Overbought")
strategy.close("Short", when=rsiValue < rsiOversold, comment="Exit Short on RSI Oversold")