
이 전략은 과매수 및 과매도 영역에서 K-라인과 D-라인의 교차 신호를 모니터링하여 거래 결정을 내리는 스토캐스틱 RSI(Stochastic RSI)를 기반으로 한 적응형 거래 시스템입니다. 이 전략은 기존 RSI와 확률적 지표의 장점을 통합하여 가격 모멘텀과 변동성을 이중으로 확인함으로써 더욱 신뢰할 수 있는 거래 신호를 제공합니다.
전략의 핵심 논리는 다음과 같은 핵심 단계에 기초합니다.
위험 관리 제안:
이 전략은 RSI와 확률론적 지표의 장점을 결합하여 신뢰할 수 있는 거래 시스템을 만듭니다. 이 전략의 핵심 장점은 신호의 신뢰성과 시스템의 확장성에 있습니다. 합리적인 매개변수 설정과 위험 제어 메커니즘을 통해 다양한 시장 환경에서 안정적인 성과를 유지할 수 있습니다. 거래자는 특정 시장 특성에 따라 매개변수를 조정하고 실제 거래에서 이를 사용할 때 위험 관리에 주의를 기울이는 것이 좋습니다.
/*backtest
start: 2024-11-26 00:00:00
end: 2024-12-25 08:00:00
period: 4h
basePeriod: 4h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Stochastic RSI Strategy", overlay=true)
// Ayarlar
k_period = input.int(14, title="K Period")
d_period = input.int(3, title="D Period")
stoch_length = input.int(14, title="Stoch Length")
stoch_smoothK = input.int(3, title="Stoch SmoothK")
stoch_smoothD = input.int(3, title="Stoch SmoothD")
lower_band = input.int(20, title="Lower Band")
upper_band = input.int(80, title="Upper Band")
start_date = input(timestamp("2023-01-01 00:00"), title="Start Date")
end_date = input(timestamp("2024-12-31 23:59"), title="End Date")
use_date_filter = input.bool(true, title="Use Date Filter")
// Stochastic RSI hesaplama
rsi = ta.rsi(close, stoch_length)
stoch_rsi = ta.stoch(rsi, rsi, rsi, k_period)
K = ta.sma(stoch_rsi, stoch_smoothK)
D = ta.sma(K, stoch_smoothD)
// Tarih filtresi
is_in_date_range = true
// Alım-satım koşulları
long_condition = ta.crossover(K, D) and K < lower_band and is_in_date_range
short_condition = ta.crossunder(K, D) and K > upper_band and is_in_date_range
// İşlemleri yürüt
if (long_condition)
strategy.close("Short")
strategy.entry("Long", strategy.long)
if (short_condition)
strategy.close("Long")
strategy.entry("Short", strategy.short)
// Grafikte göstergeleri çiz
plot(K, title="K Line", color=color.blue)
plot(D, title="D Line", color=color.red)
hline(lower_band, "Lower Band", color=color.green)
hline(upper_band, "Upper Band", color=color.red)