
이 전략은 상대 강도 지수(RSI), 가중 이동 평균(WMA), 지수 이동 평균(EMA)을 결합한 추세 추종 거래 시스템입니다. 이 전략은 여러 가지 기술 지표를 조화롭게 활용하여 추세 전환점에서 시장 모멘텀의 변화를 포착하고, 이를 통해 거래 신호를 생성합니다. 이 시스템은 WMA와 EMA의 교차를 활용하여 추세 방향을 확인하고, RSI 지표를 결합하여 시장 상황을 필터링하여 거래의 정확도를 높입니다.
전략의 핵심 논리는 다음과 같은 핵심 요소에 기초합니다.
이는 여러 기술 지표를 기반으로 하는 추세 추적 전략입니다. RSI, WMA, EMA를 조정하여 사용하여 거래 안정성을 보장하면서 시장 추세 전환점을 포착하려고 노력합니다. 특정 히스테리시스 및 거짓 신호 위험이 있기는 하지만, 합리적인 최적화 및 위험 관리 조치를 통해 이 전략은 좋은 실질적 가치와 확장 가능성을 제공합니다.
/*backtest
start: 2024-12-17 00:00:00
end: 2025-01-16 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT","balance":49999}]
*/
//@version=5
strategy(title="RSI + WMA + EMA Strategy", shorttitle="RSI Strategy", overlay=true)
// RSI Settings
rsiLengthInput = input.int(14, minval=1, title="RSI Length", group="RSI Settings")
rsiSourceInput = input.source(close, "Source", group="RSI Settings")
// WMA and EMA Settings
wmaLengthInput = input.int(45, minval=1, title="WMA Length", group="WMA Settings")
wmaColorInput = input.color(color.blue, title="WMA Color", group="WMA Settings")
emaLengthInput = input.int(89, minval=1, title="EMA Length", group="EMA Settings")
emaColorInput = input.color(color.purple, title="EMA Color", group="EMA Settings")
// RSI Calculation
change = ta.change(rsiSourceInput)
up = ta.rma(math.max(change, 0), rsiLengthInput)
down = ta.rma(-math.min(change, 0), rsiLengthInput)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
// WMA and EMA Calculation
wma = ta.wma(rsi, wmaLengthInput)
ema = ta.ema(rsi, emaLengthInput)
// RSI Color Logic
rsiColor = rsi > 70 ? color.new(color.green, 100 - math.round(rsi)) : rsi < 30 ? color.new(color.red, math.round(rsi)) : color.new(color.blue, 50)
// Plot RSI, WMA, and EMA
plot(rsi, "RSI", color=rsiColor)
plot(wma, title="WMA", color=wmaColorInput, linewidth=2)
plot(ema, title="EMA", color=emaColorInput, linewidth=2)
// Highlight RSI Area between 30 and 70
bgcolor(rsi >= 30 and rsi <= 70 ? color.new(color.blue, 90) : na)
// Entry and Exit Conditions
longCondition = ta.crossover(wma, ema) and rsi < 50
shortCondition = ta.crossunder(wma, ema) and rsi > 50
if (longCondition)
strategy.entry("Long", strategy.long)
alert("Buy Signal: WMA crossed above EMA, RSI < 50", alert.freq_once_per_bar)
if (shortCondition)
strategy.entry("Short", strategy.short)
alert("Sell Signal: WMA crossed below EMA, RSI > 50", alert.freq_once_per_bar)
// Optional: Plot Buy/Sell Signals on Chart
plotshape(series=longCondition, style=shape.labelup, location=location.belowbar, color=color.green, size=size.small, title="Buy Signal")
plotshape(series=shortCondition, style=shape.labeldown, location=location.abovebar, color=color.red, size=size.small, title="Sell Signal")