
이 전략은 여러 기술 지표를 기반으로 하는 모멘텀 트렌드 거래 시스템입니다. 상대 강도 지수(RSI), 이동 평균 수렴 발산(MACD) 및 확률 지표를 결합하여 시장 매수 및 매도 신호를 식별합니다. 이 전략은 확률 임계값 방법을 채택하고 Z-점수 정규화를 사용하여 거래 신호를 필터링하고 거래의 신뢰성을 향상시킵니다. 이 전략은 특히 일일 수준의 추세 추종 거래에 적합합니다.
이 전략은 주로 세 가지 핵심 기술 지표를 기반으로 합니다.
이는 고전적인 기술 지표와 현대적인 통계적 방법을 결합한 혁신적인 전략입니다. 다중 지표 조정과 확률 임계값 필터링을 통해 전략의 견고성을 유지하는 동시에 거래 효율성이 향상됩니다. 이 전략은 적응성과 확장성이 뛰어나 중기, 장기 추세 거래에 적합합니다. 어느 정도 지연 위험이 존재하지만, 적절한 매개변수 최적화와 위험 관리를 통해 안정적인 거래 성과를 얻을 수 있습니다.
/*backtest
start: 2024-01-06 00:00:00
end: 2025-01-04 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("RSI-MACD-Stochastic Strategy", shorttitle = "RMS_V1", overlay=true)
// Inputs
use_macd = input.bool(true, title="Use MACD")
use_rsi = input.bool(true, title="Use RSI")
use_stochastic = input.bool(true, title="Use Stochastic")
threshold_buy = input.float(0.5, title="Buy Threshold (Probability)")
threshold_sell = input.float(-0.5, title="Sell Threshold (Probability)")
// Indicators
// RSI
rsi_period = input.int(14, title="RSI Period")
rsi = ta.rsi(close, rsi_period)
// Stochastic Oscillator
stoch_k = ta.stoch(close, high, low, rsi_period)
stoch_d = ta.sma(stoch_k, 3)
// MACD
[macd_line, signal_line, _] = ta.macd(close, 12, 26, 9)
// Calculate Z-score
lookback = input.int(20, title="Z-score Lookback Period")
mean_close = ta.sma(close, lookback)
stddev_close = ta.stdev(close, lookback)
zscore = (close - mean_close) / stddev_close
// Buy and Sell Conditions
long_condition = (use_rsi and rsi < 30) or (use_stochastic and stoch_k < 20) or (use_macd and macd_line > signal_line)
short_condition = (use_rsi and rsi > 70) or (use_stochastic and stoch_k > 80) or (use_macd and macd_line < signal_line)
buy_signal = long_condition and zscore > threshold_buy
sell_signal = short_condition and zscore < threshold_sell
// Trading Actions
if (buy_signal)
strategy.entry("Buy", strategy.long)
if (sell_signal)
strategy.entry("Sell", strategy.short)