
이 전략은 다주기 지수 이동 평균 ((EMA) 와 상대적으로 강한 지표 ((RSI) 를 기반으로 한 트렌드 추적 거래 시스템이다. 이 전략은 20, 50, 100의 3주기 EMA 트렌드를 판단하여 가격 돌파와 RSI 오버 바이 신호를 결합하여 거래 결정을 내린다. 이 전략은 주로 트렌딩 시장에 적용되며, 다중 기술 지표의 검증을 통해 거래의 정확성을 높인다.
전략의 핵심 논리는 다음과 같은 핵심 부분으로 구성됩니다.
이것은 트렌드 추적과 동력 반전을 결합한 복합 전략 시스템이다. 여러 가지 기술 지표의 조합 사용으로 전략이 간단하고 이해하기 쉽게 유지되는 동시에 더 나은 위험 수익 특성을 달성한다. 전략의 핵심 장점은 엄격한 트렌드 확인 장치와 완벽한 위험 제어 시스템이지만 실제 응용에서는 매개 변수 최적화 및 시장 환경에 대한 적합성에 주의를 기울여야 한다. 제안된 최적화 방향에 따라 전략에는 더 많은 개선의 여지가 있다.
/*backtest
start: 2024-02-18 00:00:00
end: 2025-02-17 00:00:00
period: 4h
basePeriod: 4h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("EMA Crossover + RSI Strategy", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=200)
// Calculate EMAs
ema20 = ta.ema(close, 20)
ema50 = ta.ema(close, 50)
ema100 = ta.ema(close, 100)
// Calculate RSI
rsiPeriod = 14
rsiValue = ta.rsi(close, rsiPeriod)
// Determine if each EMA is trending up (current value greater than the previous value)
ema20_trending_up = ema20 > ema20[1]
ema50_trending_up = ema50 > ema50[1]
ema100_trending_up = ema100 > ema100[1]
all_emas_trending_up = ema20_trending_up and ema50_trending_up and ema100_trending_up
// Buy condition:
// 1. Price crosses above the EMA20 from below (using ta.crossover)
// 2. All three EMAs are trending upward
buySignal = ta.crossover(close, ema20) and all_emas_trending_up
// Sell conditions:
// Sell if RSI is above 70 OR price crosses below the EMA20 from above (using ta.crossunder)
sellSignal = (rsiValue > 70) or ta.crossunder(close, ema20)
// Enter a long position if the buy condition is met
if (buySignal)
strategy.entry("Long", strategy.long)
// Exit the long position if either sell condition is met
if (sellSignal)
strategy.close("Long")
// Plot the EMAs on the chart for visualization
plot(ema20, color=color.blue, title="EMA 20")
plot(ema50, color=color.orange, title="EMA 50")
plot(ema100, color=color.green, title="EMA 100")
// (Optional) Plot the RSI and a horizontal line at 70 for reference
plot(rsiValue, title="RSI", color=color.purple)
hline(70, title="Overbought (70)", color=color.red)