
이것은 윌리엄스 인덱스 (Williams %R) 와 상대적으로 강한 인덱스 (RSI) 의 쌍동력 돌파구 확인을 기반으로 한 양적 거래 전략이다. 이 전략은 두 동력 지표의 교차 돌파구를 관찰하여 거래 신호를 확인하고, 가짜 돌파구로 인한 위험을 효과적으로 줄인다. 이 전략은 오버 바이 오버 셀 영역에서 거래 기회를 찾고, 두 지표의 공동 확인을 통해 거래의 정확성을 높인다.
전략은 30주기의 윌리엄스 %R와 7주기의 RSI를 주요 지표로 사용한다. 윌리엄스 %R이 상향 80을 돌파하고 RSI가 동시에 상향 20을 돌파하면, 다중 신호가 트리거된다. 윌리엄스 %R이 하향 20을 돌파하고 RSI가 동시에 하향 80을 돌파하면, 공백 신호가 트리거된다. 이 이중 확인 메커니즘은 단일 지표에서 생성될 수 있는 가짜 신호를 효과적으로 필터링한다. 전략은 수동으로 계산하는 윌리엄스 %R 방식을 채택하고, 계산 속의 주기 내에서 최고 가격과 최저 가격을 통해 더 정확한 지표 값을 얻는다.
이 전략은 윌리엄스 %R와 RSI의 연동 작용을 통해 안정적인 거래 시스템을 구축한다. 이중 동력 확인 메커니즘은 가짜 신호 위험을 효과적으로 감소시키고, 오버 바이 오버 셀 영역의 거래는 좋은 수익 잠재력을 가지고 있다. 합리적인 위험 제어와 지속적인 최적화를 통해 전략은 다양한 시장 환경에서 안정적인 성능을 유지할 수 있다.
/*backtest
start: 2024-11-12 00:00:00
end: 2024-12-11 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Williams %R + RSI Strategy", overlay=true)
// Inputs for Williams %R
wpr_length = input.int(30, title="Williams %R Length", minval=1)
wpr_upper = input.int(-20, title="Williams %R Upper Band", minval=-100, maxval=0)
wpr_lower = input.int(-80, title="Williams %R Lower Band", minval=-100, maxval=0)
// Inputs for RSI
rsi_length = input.int(7, title="RSI Length", minval=1)
rsi_upper = input.int(80, title="RSI Upper Band", minval=0, maxval=100)
rsi_lower = input.int(20, title="RSI Lower Band", minval=0, maxval=100)
// Calculate Williams %R Manually
highest_high = ta.highest(high, wpr_length)
lowest_low = ta.lowest(low, wpr_length)
wpr = ((highest_high - close) / (highest_high - lowest_low)) * -100
// Calculate RSI
rsi = ta.rsi(close, rsi_length)
// Entry and Exit Conditions
longCondition = ta.crossover(wpr, wpr_lower) and ta.crossover(rsi, rsi_lower)
shortCondition = ta.crossunder(wpr, wpr_upper) and ta.crossunder(rsi, rsi_upper)
// Plot Buy/Sell Signals
plotshape(series=longCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=shortCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Strategy Entry and Exit
if (longCondition)
strategy.entry("Buy", strategy.long)
if (shortCondition)
strategy.entry("Sell", strategy.short)