
이 전략은 이중 지수 이동 평균(EMA)과 확률적 오실레이터를 결합한 양적 거래 시스템입니다. 20기간과 50기간 EMA를 사용하여 시장 동향을 파악하고, 확률적 오실레이터를 사용하여 매수 과다 및 매도 과다 영역에서 거래 기회를 찾아 추세와 모멘텀의 완벽한 조합을 달성합니다. 이 전략은 고정 손절매 및 이익 목표 설정을 포함한 엄격한 위험 관리 조치를 채택합니다.
전략의 핵심 논리는 추세 판단, 진입 시점, 위험 관리라는 세 부분으로 나뉩니다. 추세 판단은 주로 빠른 EMA(20주기)와 느린 EMA(50주기)의 상대적 위치에 의존합니다. 빠른 선이 느린 선 위에 있으면 상승 추세로 판단되고, 그렇지 않으면 하락 추세로 판단됩니다. . 진입 신호는 확률적 오실레이터의 교차로 확인되며, 매수 과다 및 매도 과다 영역에서 높은 확률의 거래 기회를 찾습니다. 위험 관리에서는 고정 비율의 손절매와 2배의 이익 실현 비율 설정을 사용하여 각 거래에 명확한 위험-수익 비율이 적용되도록 합니다.
이 전략은 추세 지표와 모멘텀 지표를 결합하여 완전한 거래 시스템을 만듭니다. 이 전략의 핵심적인 장점은 명확한 논리적 프레임워크와 엄격한 위험 관리에 있지만, 실제 적용에서는 여전히 특정 시장 상황에 따른 매개변수 최적화가 필요합니다. 지속적인 개선과 최적화를 통해 이 전략은 다양한 시장 환경에서 안정적인 성과를 유지할 것으로 기대됩니다.
/*backtest
start: 2024-12-06 00:00:00
end: 2025-01-04 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("EMA + Stochastic Strategy", overlay=true)
// Inputs for EMA
emaShortLength = input.int(20, title="Short EMA Length")
emaLongLength = input.int(50, title="Long EMA Length")
// Inputs for Stochastic
stochK = input.int(14, title="Stochastic %K Length")
stochD = input.int(3, title="Stochastic %D Smoothing")
stochOverbought = input.int(85, title="Stochastic Overbought Level")
stochOversold = input.int(15, title="Stochastic Oversold Level")
// Inputs for Risk Management
riskRewardRatio = input.float(2.0, title="Risk-Reward Ratio")
stopLossPercent = input.float(1.0, title="Stop Loss (%)")
// EMA Calculation
emaShort = ta.ema(close, emaShortLength)
emaLong = ta.ema(close, emaLongLength)
// Stochastic Calculation
k = ta.stoch(high, low, close, stochK)
d = ta.sma(k, stochD)
// Trend Condition
isUptrend = emaShort > emaLong
isDowntrend = emaShort < emaLong
// Stochastic Signals
stochBuyCrossover = ta.crossover(k, d)
stochBuySignal = k < stochOversold and stochBuyCrossover
stochSellCrossunder = ta.crossunder(k, d)
stochSellSignal = k > stochOverbought and stochSellCrossunder
// Entry Signals
buySignal = isUptrend and stochBuySignal
sellSignal = isDowntrend and stochSellSignal
// Strategy Execution
if buySignal
strategy.entry("Buy", strategy.long)
stopLoss = close * (1 - stopLossPercent / 100)
takeProfit = close * (1 + stopLossPercent * riskRewardRatio / 100)
strategy.exit("Take Profit/Stop Loss", from_entry="Buy", stop=stopLoss, limit=takeProfit)
if sellSignal
strategy.entry("Sell", strategy.short)
stopLoss = close * (1 + stopLossPercent / 100)
takeProfit = close * (1 - stopLossPercent * riskRewardRatio / 100)
strategy.exit("Take Profit/Stop Loss", from_entry="Sell", stop=stopLoss, limit=takeProfit)
// Plotting
plot(emaShort, color=color.blue, title="Short EMA")
plot(emaLong, color=color.red, title="Long EMA")