
이 전략은 가우스 채널 (Gaussian Channel) 과 무작위 RSI 지표 (Stochastic 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")