
이 전략은 가우스 채널 (Gaussian Channel) 과 무작위적으로 상대적으로 약한 지표 (Stochastic RSI) 를 결합한 정량 거래 시스템이다. 이 전략은 가우스 채널과 가격의 교차와 무작위적인 RSI의 움직임을 통해 시장의 트렌드 반전 기회를 포착한다. 가우스 채널은 이동 평균과 표준 차원에서 구성되어 있으며, 시장의 변동 범위를 동적으로 반영하고, 무작위적인 RSI는 역동성 측면의 확인 신호를 제공합니다.
전략의 핵심 논리는 다음과 같은 핵심 부분으로 구성됩니다.
이 전략은 기술 분석의 트렌드 추적과 동적 지표를 결합하여 논리적으로 완전하고 위험을 제어 할 수있는 정량 거래 시스템을 구축합니다. 일부 고유한 위험이 있지만 지속적인 최적화와 개선으로 전략은 다양한 시장 환경에서 안정적인 성능을 유지할 것으로 예상됩니다. 전략의 모듈 디자인은 또한 후속 최적화 및 확장을위한 좋은 토대를 제공합니다.
/*backtest
start: 2024-02-21 00:00:00
end: 2025-02-18 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"BNB_USDT"}]
*/
//@version=5
strategy("SAJJAD JAMSHIDI Channel with Stochastic RSI Strategy", overlay=true, commission_type=strategy.commission.percent, commission_value=0.1, slippage=0, default_qty_type=strategy.percent_of_equity, default_qty_value=100, process_orders_on_close=true)
// Gaussian Channel Inputs
lengthGC = input.int(20, "Gaussian Channel Length", minval=1)
multiplier = input.float(2.0, "Standard Deviation Multiplier", minval=0.1)
// Calculate Gaussian Channel
basis = ta.ema(close, lengthGC)
deviation = multiplier * ta.stdev(close, lengthGC)
upperChannel = basis + deviation
lowerChannel = basis - deviation
// Plot Gaussian Channel
plot(basis, "Basis", color=color.blue)
plot(upperChannel, "Upper Channel", color=color.green)
plot(lowerChannel, "Lower Channel", color=color.red)
// Stochastic RSI Inputs
rsiLength = input.int(14, "RSI Length", minval=1)
stochLength = input.int(14, "Stochastic Length", minval=1)
smoothK = input.int(3, "Smooth K", minval=1)
smoothD = input.int(3, "Smooth D", minval=1)
// Calculate RSI
rsi = ta.rsi(close, rsiLength)
// Calculate Stochastic RSI
lowestRSI = ta.lowest(rsi, stochLength)
highestRSI = ta.highest(rsi, stochLength)
stochRSI = (rsi - lowestRSI) / (highestRSI - lowestRSI) * 100
k = ta.sma(stochRSI, smoothK)
d = ta.sma(k, smoothD)
// Trading Conditions
stochUp = k > d
priceAboveUpper = ta.crossover(close, upperChannel)
priceBelowUpper = ta.crossunder(close, upperChannel)
strategy.entry("Long", strategy.long, when=priceAboveUpper and stochUp)
strategy.close("Long", when=priceBelowUpper)