
この戦略は,ガウスチャンネルとランダムなRSI指標であるストキャスティックRSIに基づいた量的な取引システムである. この戦略は,技術分析の平均回帰と動力の原理を組み合わせて,価格がチャネル下軌道に触れると,ランダムなRSI指標がオーバーセールシグナルを示したときに買い入れ,価格がチャネル上軌道に触れると,またはランダムなRSI指標がオーバーセールシグナルを示したときに売り出しを行う. この戦略は,空白操作を行わずに,多取引のためにのみ使用される.
戦略の核心的な論理は,以下のいくつかの重要な計算に基づいています.
この戦略は,ガウス経路とランダムなRSI指標を組み合わせて,比較的安定した取引システムを構築している.戦略の優位性は,二重確認機構と完善したリスク管理にあるが,異なる市場環境への適応性にも注意する必要がある.自己適応パラメータと市場環境の識別などの最適化方向を導入することにより,戦略の安定性と収益性をさらに向上させることができる.
/*backtest
start: 2024-02-18 00:00:00
end: 2025-01-30 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Gaussian Channel with Stochastic RSI", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=200, commission_type=strategy.commission.percent, commission_value=0.1, slippage=0)
// Gaussian Channel Parameters
gc_length = input.int(20, "Gaussian Channel Length", minval=1)
gc_mult = input.float(2.0, "Gaussian Channel Multiplier", minval=0.1)
middle = ta.ema(close, gc_length)
stdev = ta.stdev(close, gc_length)
upper = middle + gc_mult * stdev
lower = middle - gc_mult * stdev
// Plot Channels
plot(middle, "Middle Line", color=color.blue)
plot(upper, "Upper Channel", color=color.red)
plot(lower, "Lower Channel", color=color.green)
// Stochastic RSI Parameters
rsi_length = input.int(14, "RSI Length", minval=1)
stoch_length = input.int(14, "Stochastic Length", minval=1)
smooth_k = input.int(3, "Smooth %K", minval=1)
oversold = input.int(20, "Oversold Level", minval=0, maxval=100)
overbought = input.int(80, "Overbought Level", minval=0, maxval=100)
// Calculate Stochastic RSI
rsi = ta.rsi(close, rsi_length)
lowest_rsi = ta.lowest(rsi, stoch_length)
highest_rsi = ta.highest(rsi, stoch_length)
stoch_rsi = highest_rsi != lowest_rsi ? (rsi - lowest_rsi) / (highest_rsi - lowest_rsi) * 100 : 0
k = ta.sma(stoch_rsi, smooth_k)
// Entry/Exit Conditions
enterLong = ta.crossover(close, lower) and ta.crossover(k, oversold)
exitLong = ta.crossover(close, upper) or ta.crossunder(k, overbought)
// Strategy Execution
if (time >= timestamp(2018, 01, 01, 0, 0) and time < timestamp(2069, 01, 01, 0, 0))
if enterLong
strategy.entry("Long", strategy.long)
if exitLong
strategy.close("Long")