
이 전략은 평균 회귀와 트렌드 추적을 결합 한 혼합 전략 시스템으로, RSI, 브린 밴드 및 다중 EMA 지표의 조합을 통해 시장의 과매매 과매매 기회를 포착합니다. 이 전략은 전통적인 기술 분석 지표에 기반하여 트렌드 확인과 범위 흔들림 판단을 증가시키고 전략의 정확성을 효과적으로 향상시킵니다.
전략은 트레이드 신호를 확인하기 위해 3번의 검증 메커니즘을 사용합니다. 우선 RSI 지표를 통해 과매도 과매도 지역을 식별하고 RSI가 30 이하 또는 70 이하일 때 초기 신호를 트리거합니다. 다음으로, 부린 밴드 ((BB) 를 가격 변동 범위의 참고로 사용하여, 가격이 경로를 돌파하거나 경로를 벗어날 때 추가 신호를 확인합니다. 마지막으로 100⁄50 일 EMA의 상대적 위치와 변동성을 통해 시장 추세를 판단하고, 트렌드 방향이 이전 두 신호와 일치하는 경우에만 거래를 수행합니다. 전략은 EMA의 변동률 판단을 추가하여 전체 시장을 식별합니다.
이 전략은 여러 기술 지표의 연동 작용을 통해 안정성을 보장하면서 전략의 유연성을 동시에 고려한다. 전략 논리는 명확하고, 구현 방법은 간단하며, 실용적인 가치가 좋다. 합리적인 매개 변수 최적화 및 위험 관리를 통해 전략은 다양한 시장 환경에서 안정적인 성능을 유지할 것으로 보인다.
/*backtest
start: 2024-01-01 00:00:00
end: 2024-11-11 00:00:00
period: 3h
basePeriod: 3h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("BTC Dominance Analysis Strategy (Improved)", overlay=true)
// Input Parameters
rsi_period = input(14, title="RSI Period")
bb_period = input(20, title="Bollinger Band Period")
bb_std_dev = input(2.0, title="Bollinger Std Dev")
ema_period = input(100, title="100 EMA Period")
ema_30_period = input(30, title="30 EMA Period")
ema_50_period = input(50, title="50 EMA Period")
// RSI Calculation
rsi_value = ta.rsi(close, rsi_period)
// Bollinger Bands Calculation
basis = ta.sma(close, bb_period)
dev = bb_std_dev * ta.stdev(close, bb_period)
upper_bb = basis + dev
lower_bb = basis - dev
// EMA Calculation
ema_100 = ta.ema(close, ema_period)
ema_30 = ta.ema(close, ema_30_period)
ema_50 = ta.ema(close, ema_50_period)
// Determine EMA trends
range_bound_ema = math.abs(ema_100 - ta.sma(ema_100, 10)) < ta.stdev(ema_100, 10)
uptrend_ema = ema_100 > ema_50
downtrend_ema = ema_100 < ema_50
// Long Condition: All 3 conditions must be met
// 1. RSI < 30
// 2. BTC Dominance < lower Bollinger Band
// 3. 100 EMA must be range-bound or in an uptrend (but NOT in a downtrend)
long_condition = (rsi_value < 30) and (close < lower_bb) and (range_bound_ema or uptrend_ema)
// Short Condition: All 3 conditions must be met
// 1. RSI > 70
// 2. BTC Dominance > upper Bollinger Band
// 3. 100 EMA must be range-bound or in a downtrend (but NOT in an uptrend)
short_condition = (rsi_value > 70) and (close > upper_bb) and (range_bound_ema or downtrend_ema)
// Plot Buy and Sell Signals for Debugging
plotshape(long_condition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(short_condition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Execute Buy Trade
if (long_condition)
strategy.entry("Buy", strategy.long)
// Execute Sell Trade
if (short_condition)
strategy.entry("Sell", strategy.short)
// Plot Bollinger Bands and EMA
plot(upper_bb, color=color.red, title="Upper Bollinger Band")
plot(lower_bb, color=color.green, title="Lower Bollinger Band")
plot(ema_100, color=color.blue, title="100 EMA")
plot(ema_50, color=color.orange, title="50 EMA")
// plot(rsi_value, "RSI", color=color.purple)
// Display background color for Buy and Sell signals
bgcolor(long_condition ? color.new(color.green, 90) : na, title="Buy Background")
bgcolor(short_condition ? color.new(color.red, 90) : na, title="Sell Background")