
これは,ウィリアムズ指数 ((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)