
이 전략은 무작위적으로 비교적 약한 지수 ((Stochastic RSI) 와 그래프 형태를 결합한 복합적인 거래 시스템이다. 시스템은 SRSI 지표의 오버 바이 오버 셀 레벨을 분석하여 가격 움직임의 그래프를 확인하고, 완전히 자동화된 거래 신호 생성을 구현한다. 전략은 첨단 기술 지표 조합 방법을 채택하고, 트렌드 추적과 역전 거래의 특성을 결합하여 강력한 시장 적응력을 가지고 있다.
전략의 핵심 논리는 다음과 같은 핵심 요소에 기초합니다.
이 전략은 무작위 RSI 지표와 그래프 형태를 결합하여 안정적인 거래 시스템을 구축한다. 시스템은 작동을 간소하게 유지하면서도 좋은 위험 관리를 실현한다. 합리적인 매개 변수 최적화 및 신호 필터링을 통해 전략은 다양한 시장 환경에 적응할 수 있다. 거래자는 실장에 사용하기 전에 충분한 역사적 데이터 재검토를 수행하고 특정 시장 특성에 따라 매개 변수 설정을 조정하는 것이 좋습니다.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-27 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Stochastic RSI Strategy with Candlestick Confirmation", overlay=true)
// Input parameters for Stochastic RSI
rsiPeriod = input.int(14, title="RSI Period")
stochRsiPeriod = input.int(14, title="Stochastic RSI Period")
kPeriod = input.int(3, title="K Period")
dPeriod = input.int(3, title="D Period")
// Overbought and Oversold levels
overboughtLevel = input.int(80, title="Overbought Level", minval=50, maxval=100)
oversoldLevel = input.int(20, title="Oversold Level", minval=0, maxval=50)
// Calculate RSI
rsi = ta.rsi(close, rsiPeriod)
// Calculate Stochastic RSI
stochRSI = ta.stoch(rsi, rsi, rsi, stochRsiPeriod) // Stochastic RSI calculation using the RSI values
// Apply smoothing to StochRSI K and D lines
k = ta.sma(stochRSI, kPeriod)
d = ta.sma(k, dPeriod)
// Plot Stochastic RSI on separate panel
plot(k, title="StochRSI K", color=color.green, linewidth=2)
plot(d, title="StochRSI D", color=color.red, linewidth=2)
hline(overboughtLevel, "Overbought", color=color.red, linestyle=hline.style_dashed)
hline(oversoldLevel, "Oversold", color=color.green, linestyle=hline.style_dashed)
// Buy and Sell Signals based on both Stochastic RSI and Candlestick patterns
buySignal = ta.crossover(k, oversoldLevel) and close > open // Buy when K crosses above oversold level and close > open (bullish candle)
sellSignal = ta.crossunder(k, overboughtLevel) and close < open // Sell when K crosses below overbought level and close < open (bearish candle)
// Plot Buy/Sell signals as shapes on the chart
plotshape(series=buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY", size=size.small)
plotshape(series=sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL", size=size.small)
// Background color shading for overbought/oversold conditions
bgcolor(k > overboughtLevel ? color.new(color.red, 90) : na)
bgcolor(k < oversoldLevel ? color.new(color.green, 90) : na)
// Place actual orders with Stochastic RSI + candlestick pattern confirmation
if (buySignal)
strategy.entry("Long", strategy.long)
if (sellSignal)
strategy.entry("Short", strategy.short)
// Optionally, you can add exit conditions for closing long/short positions
// Close long if K crosses above the overbought level
if (ta.crossunder(k, overboughtLevel))
strategy.close("Long")
// Close short if K crosses below the oversold level
if (ta.crossover(k, oversoldLevel))
strategy.close("Short")