RSI 간격 돌파 전략은 전형적인 트렌드 추적 전략이다. 그것은 상대적으로 강한 지수 ((RSI) 를 주요 기술 지표로 사용하여, RSI가 과매매 또는 과매매 상태에 있을 때, 범위에 돌파하는 기회를 찾고 포지션을 구축하여 트렌드 추적의 목적을 달성한다.
이 전략은 주로 RSI 지표에 의존하여 시장의 과매매 상태를 판단한다. RSI 지표의 계산 공식은 다음과 같다: RSI = ((상승 평균값/상승 평균값 +상승 평균값) × 100 ᅳ. 그 중, 상승 평균값은 지난 N 일 동안의 매출 상승률의 간단한 이동 평균이며, 하락 평균값은 지난 N 일 동안의 매출 하락률의 간단한 이동 평균이다.
RSI가 설정된 오버 바이 라인 (기본 80) 보다 크면, 시장이 오버 바이 상태임을 나타냅니다. RSI가 설정된 오버 바이 라인 (기본 35) 보다 작으면, 시장이 오버 바이 영역에 있음을 나타냅니다. 전략은 RSI가 상향으로 오버 바이 라인을 돌파 할 때 단축 기회를 찾고, RSI가 상향으로 오버 바이 라인을 돌파 할 때 더 많은 기회를 찾습니다.
구체적으로, 전략은 두 개의 SMA 평균선을 통해 RSI 지표의 추세를 판단한다. 빠른 라인이 아래에서 위로 느린 라인을 돌파하고 RSI가 초과 범위를 돌파 할 때, 더 많이; 빠른 라인이 위에서 아래로 느린 라인을 돌파하고 RSI가 초과 라인을 돌파 할 때, 더 많이. 전략은 또한 위험을 제어하기 위해 중지 라인과 중지 라인을 설정한다.
RSI 간격 돌파 전략은 전체적으로 전형적인 트렌드 추적 전략이다. 그것은 RSI 지표를 통해 매도 시점을 판단하고, 쌍 SMA 평균 필터 신호를 설정하고, 손해 중지 을 설정하여 위험을 제어한다. 그러나 RSI 지표에는 지연성 문제가 있으며, 이외에도 파라미터를 적절하게 설정하지 않으면 전략의 성능에도 영향을 미칩니다. 추가적인 최적화를 통해 이 전략의 트렌드 추적 능력을 충분히 발휘할 수 있다.
/*backtest
start: 2023-09-10 00:00:00
end: 2023-10-10 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
//strategy("Strategy RSI | Fadior", shorttitle="Strategy RSI", pyramiding=10, calc_on_order_fills=false, initial_capital=10000, default_qty_type=strategy.percent_of_equity, currency="USD", default_qty_value=100, overlay=false)
len = input(3, minval=1, title="RSI Length")
threshLow = input(title="Treshold Low", defval=35)
threshHigh = input(title="Treshold High", defval=80)
rsiLength1 = input(title="RSI Smoothing 1", defval=3)
rsiLength2 = input(title="RSI Smoothing 2", defval=5)
SL = input(title="Stop loss %", type=float, defval=.026, step=.001)
TP = input( defval=300)
// 3 40 70 2
// 14 40 70 2 16 0.05 50
src = close
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
plot(sma(rsi,rsiLength2), color=orange)
plot(sma(rsi,rsiLength1), color=green)
band1 = hline(threshHigh)
band0 = hline(threshLow)
fill(band1, band0, color=purple, transp=90)
strategy = input(type=bool, title="Long only ?", defval=true)
strategy.risk.allow_entry_in(strategy ? strategy.direction.long : strategy.direction.all)
longCondition = sma(rsi,rsiLength1) < threshLow and sma(rsi,rsiLength2) > sma(rsi,rsiLength2)[1]
if (longCondition)
strategy.entry("Long", strategy.long) //, qty=10)
strategy.exit("Close Long", "Long", stop=src-close*SL, profit=TP)
shortCondition = sma(rsi,rsiLength1) > threshHigh and sma(rsi,rsiLength2) < sma(rsi,rsiLength2)[1]
if (shortCondition)
strategy.entry("Short", strategy.short) //, qty=10)
strategy.exit("Close Short", "Short") //, stop=src-close*SL, profit=TP)