
RSI 강도 필터링 트레이딩 전략과 함께 쌍방향 이동 평균 교차
이 전략은 양평선 교차와 RSI 지표 필터링을 결합한 거래 시스템이다. 전략은 5주기 지수 이동 평균 ((EMA5)) 과 10주기 단순 이동 평균 ((SMA10) 을 주요 트렌드 판단 도구로 사용하며, 14주기 상대적으로 강한 지수 ((RSI14) 를 거래 신호 필터로 도입하여 엄격한 입출장 조건을 통해 거래의 정확성을 향상시킵니다.
이 전략의 핵심 논리는 두 가지 핵심 기술 지표의 조합에 기반합니다.
신호 확인 메커니즘
리스크 관리가 효과적입니다.
전략 논리가 명확합니다.
변동성 있는 시장의 위험
지연 위험
매개변수 민감도
트렌드 강도 필터를 도입합니다.
최적화 매개 변수가 적응
위험 관리 개선
이 전략은 쌍평선 크로스와 RSI 필터를 결합하여 비교적 완벽한 거래 시스템을 구축한다. 전략의 주요 장점은 신호 확인 메커니즘과 위험 제어 조치이지만, 일부 고유한 한계도 있다. 제안된 최적화 방향을 통해 전략은 실제 거래에서 더 나은 성과를 낼 것으로 예상된다. 특히 추세가 명확한 시장 환경에서 전략의 성과는 더 안정적일 수 있다.
/*backtest
start: 2024-06-20 00:00:00
end: 2024-12-01 00:00:00
period: 3d
basePeriod: 3d
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
//@version=5
strategy("EMA and SMA Crossover with RSI14 Filtering", overlay=true)
// Define parameters for EMA, SMA, and RSI
ema5_length = 5
sma10_length = 10
rsi14_length = 14
rsi60_level = 60
rsi50_level = 50
// Calculate EMAs, SMAs, and RSI
ema5 = ta.ema(close, ema5_length)
sma10 = ta.sma(close, sma10_length)
rsi14 = ta.rsi(close, rsi14_length)
// Define Crossover Conditions
positive_crossover = ta.crossover(ema5, sma10)
negative_crossover = ta.crossunder(ema5, sma10)
// Define RSI filter conditions
rsi_above_60 = rsi14 > rsi60_level
rsi_below_50 = rsi14 < rsi50_level
// Condition: price below 60 on RSI 14 and later crosses above for Buy
price_below_rsi60 = close < rsi14
price_above_rsi60 = close > rsi14
// Condition: price above 50 on RSI 14 and later crosses below for Sell
price_above_rsi50 = close > rsi14
price_below_rsi50 = close < rsi14
// Trading logic
var bool active_buy_trade = false
var bool active_sell_trade = false
// Buy Condition: EMA 5 crosses above SMA 10 and RSI 14 crosses above 60
if (positive_crossover and not active_buy_trade)
if (price_below_rsi60)
// Wait for price to cross above RSI 60
if (price_above_rsi60)
strategy.entry("Buy", strategy.long)
active_buy_trade := true
else
strategy.entry("Buy", strategy.long)
active_buy_trade := true
// Sell Condition: EMA 5 crosses below SMA 10 and RSI 14 crosses below 50
if (negative_crossover and not active_sell_trade)
if (price_above_rsi50)
// Wait for price to cross below RSI 50
if (price_below_rsi50)
strategy.entry("Sell", strategy.short)
active_sell_trade := true
else
strategy.entry("Sell", strategy.short)
active_sell_trade := true
// Exit Buy Condition: Reverse Signal (EMA crosses below SMA or RSI crosses below 50)
if (active_buy_trade and (negative_crossover or rsi14 < rsi50_level))
strategy.close("Buy")
active_buy_trade := false
// Exit Sell Condition: Reverse Signal (EMA crosses above SMA or RSI crosses above 60)
if (active_sell_trade and (positive_crossover or rsi14 > rsi60_level))
strategy.close("Sell")
active_sell_trade := false
// Plotting EMAs, SMAs, and RSI 14 on the chart
plot(ema5, color=color.blue, linewidth=2, title="EMA 5")
plot(sma10, color=color.red, linewidth=2, title="SMA 10")
hline(rsi60_level, "RSI 60", color=color.gray, linestyle=hline.style_dotted)
hline(rsi50_level, "RSI 50", color=color.gray, linestyle=hline.style_dotted)
plot(rsi14, color=color.green, linewidth=1, title="RSI 14")