
이 전략은 기술 분석에 기반한 트렌드 추적 시스템으로, 평행선 시스템, RSI 동력 지표 및 ATR 변동률 지표가 결합되어, 다중 신호 검증을 통해 거래 기회를 확인한다. 전략은 다중 주기 평행선 교차를 사용하여 시장 추세를 판단하고, 동시에 RSI 동력과 결합하여 가격 강도를 확인하고, 마지막으로 ATR 동력 설정을 사용하여 중지 손실 및 이득 위치를 설정하여 완전한 거래 시스템을 형성한다.
전략의 핵심 논리는 세 가지 핵심 부분으로 구성됩니다.
이 전략은 여러 기술 지표를 통합하여 논리적으로 완전한 트렌드 추적 시스템을 구축한다. 전략의 장점은 다중 신호 검증과 동적 위험 관리에 있다. 그러나 동시에 트렌드 지연 및 가짜 돌파구와 같은 위험을 처리하는 데 주의를 기울여야 한다. 트랜드 확인, 최적화 파라미터 설정 등을 추가함으로써 전략에는 여전히 큰 개선이 가능하다. 전체적으로, 이 전략은 명백한 트렌드 시장에서 작동하기에 적합하며, 중장기 트렌드를 추적하는 데 좋은 응용 가치가 있다.
/*backtest
start: 2024-11-12 00:00:00
end: 2024-12-11 08:00:00
period: 3h
basePeriod: 3h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Bullish Engulfing with EMA Crossover and ATR-Based SL/TP with RSI Filter", overlay=true)
// Inputs for moving averages
short_ema_length = input.int(100, title="Short EMA Length")
long_ema_length = input.int(200, title="Long EMA Length")
// RSI Input
rsi_length = input.int(14, title="RSI Length")
rsi_threshold = input.float(50, title="RSI Threshold")
// Calculate the Exponential Moving Averages (EMAs)
short_ema = ta.ema(close, short_ema_length)
long_ema = ta.ema(close, long_ema_length)
// Plot EMAs on the chart
plot(short_ema, color=color.blue, title="100 EMA")
plot(long_ema, color=color.red, title="200 EMA")
// Calculate RSI
rsi_value = ta.rsi(close, rsi_length)
// Plot RSI on a separate panel
hline(rsi_threshold, "RSI Threshold", color=color.gray)
plot(rsi_value, color=color.purple, title="RSI")
// Bullish Engulfing Pattern
bullish_engulfing = close > open[1] and open < close[1] and close > open
// Define strategy entry condition with RSI filter
long_condition = bullish_engulfing and short_ema > long_ema and rsi_value > rsi_threshold
// Plot a buy signal when conditions are met
plotshape(long_condition, style=shape.labelup, location=location.belowbar, color=color.green, title="Buy Signal", text="BUY")
// ATR Calculation
atr_length = input.int(14, title="ATR Length")
atr_value = ta.atr(atr_length)
// Define Stop Loss and Take Profit as levels
stop_loss_level = 1.1 * atr_value
take_profit_level = 2.0 * atr_value
// Execute Strategy Entry
if (long_condition)
strategy.entry("Buy", strategy.long)
// Adjust SL and TP levels using the entry price
if (strategy.position_size > 0)
// Calculate SL and TP relative to the entry price
stop_price = strategy.position_avg_price - stop_loss_level
limit_price = strategy.position_avg_price + take_profit_level
// Exit strategy with SL and TP
strategy.exit("Exit", from_entry="Buy", stop=stop_price, limit=limit_price)