
이 전략은 다중 기술 지표에 기반한 트렌드 추적 전략으로, 이동 평균 ((EMA), 평균 트렌드 지표 ((ADX) 및 상대적으로 약한 지표 ((RSI) 와 같은 여러 기술 지표를 통합하고, 다중 시간 프레임 분석 방법을 결합합니다. 전략은 주로 빠른 EMA와 느린 EMA의 교차를 통해 트렌드 방향을 확인하고, ADX를 사용하여 트렌드 강도를 필터링하고, RSI를 통해 시장 움직임을 판단하여 1 분 차트에 높은 주파수 거래를 수행합니다.
이 전략은 다음과 같은 핵심 메커니즘을 기반으로 작동합니다.
이 전략은 여러 기술 지표의 협동적 협동으로, 안정적인 트렌드 추적 시스템을 구축한다. 전략은 높은 승률을 유지하면서, 완벽한 위험 제어 메커니즘을 통해 상당한 수익을 달성했다.
/*backtest
start: 2024-02-19 00:00:00
end: 2025-02-17 08:00:00
period: 4h
basePeriod: 4h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Enhanced Trend Following Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=200)
// === INPUTS ===
emaFastLength = input(50, title="Fast EMA Length")
emaSlowLength = input(200, title="Slow EMA Length")
adxLength = input(14, title="ADX Length")
adxSmoothing = input(14, title="ADX Smoothing")
adxThreshold = input(25, title="ADX Threshold")
rsiLength = input(14, title="RSI Length")
rsiOverbought = input(70, title="RSI Overbought Level")
rsiOversold = input(30, title="RSI Oversold Level")
// === INDICATORS ===
emaFast = ta.ema(close, emaFastLength)
emaSlow = ta.ema(close, emaSlowLength)
[dip, dim, adxValue] = ta.dmi(adxLength, adxSmoothing)
rsiValue = ta.rsi(close, rsiLength)
// === MULTI-TIMEFRAME EMA ===
emaFastHTF = request.security(syminfo.tickerid, "240", ta.ema(close, emaFastLength))
emaSlowHTF = request.security(syminfo.tickerid, "240", ta.ema(close, emaSlowLength))
// === CONDITIONS ===
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 * 1.05, stop=close * 0.98)
if (bearishTrend)
strategy.entry("Short", strategy.short)
strategy.exit("TakeProfit_Short", from_entry="Short", limit=close * 0.95, stop=close * 1.02)
// === PLOT INDICATORS ===
plot(emaFast, color=color.blue, title="Fast EMA")
plot(emaSlow, color=color.red, title="Slow EMA")
hline(adxThreshold, "ADX Threshold", color=color.gray, linestyle=hline.style_dotted)
bgcolor(bullishTrend ? color.green : bearishTrend ? color.red : na, transp=90)
// === ALERTS ===
alertcondition(bullishTrend, title="Buy Signal", message="A bullish trend detected!")
alertcondition(bearishTrend, title="Sell Signal", message="A bearish trend detected!")
// === STRATEGY SETTINGS ===
strategy.close("Long", when=rsiValue > rsiOverbought)
strategy.close("Short", when=rsiValue < rsiOversold)