이 전략은 RSI 지표에 기반한 평선 회귀 특징을 설계했다. RSI 과잉 구매 과잉 판매 할 때 회귀가 발생하여 거래 기회를 형성한다. 이 전략은 RSI 지표를 통해 과잉 구매 과잉 판매 상태를 판단하고, 평선 회귀 방식을 사용하여 공백 포지션을 구축하여 체계화 거래 목적을 달성한다.
전략적 원칙:
RSI 지표값을 계산하고, 오버 바이 라인과 오버 소드 라인을 설정합니다. 전형적인 파라미터는 오버 바이 라인 60과 오버 소드 라인 30입니다.
RSI가 상향에서 하향으로 오버 바이 라인을 넘어서면, 판매를 하고, 짧은 포지션을 설정한다.
RSI가 상하에서 상하로 오버셀 라인을 돌파할 때, 구매를 하고, 더 많은 포지션을 설정한다.
다중 포지션 스톱 손실 라인은 입시 가격 곱하기 ((1-스톱 손실 비율), 짧은 포지션 스톱 손실 라인은 입시 가격 곱하기 ((1+스톱 손실 비율) .
가격이 스톱로스 라인을 통과했을 때 스톱 아웃을 실행하십시오.
이 전략의 장점은 다음과 같습니다.
RSI 지표의 회귀 특성을 활용하여 트렌드 회귀로 인한 거래 기회를 점진적으로 잡을 수 있습니다.
트렌드 전환을 포착할 수 있는 브레이크 시장을 구축한다.
단위 손실을 통제할 수 있는 스톱 라인을 설정한다.
이 전략의 위험은 다음과 같습니다.
RSI 지표는 가짜 신호를 발산할 가능성이 높으며, 다른 지표와 함께 확인해야 한다.
진입점 근처의 정지점은 자주 정지되며, 적절히 제한된 범위가 허용되어야 한다.
거래시기에 대한 잘못된 선택으로 인해 지분 보유 기간이 너무 길어질 수 있습니다.
요약하자면, RSI 평행선 회귀 전략은 RSI 지표의 회귀 기회를 포착하여 거래를 한다. 이 전략은 순차적으로 이루어져 단편 손실을 효과적으로 제어 할 수 있다. 그러나 RSI 지표의 신뢰성이 낮으며, 투자자는 신중하게 채택하고 다른 기술 지표로 확인하고 손실을 막는 장치를 최적화하여 장기적으로 안정적인 수익을 얻도록 지원해야합니다.
/*backtest
start: 2022-09-05 00:00:00
end: 2023-09-11 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © relevantLeader16058
//@version=4
strategy(shorttitle='RSI Bot Strategy',title='Quadency Mean Reversion Bot Strategy', overlay=true, initial_capital = 100, process_orders_on_close=true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, commission_type=strategy.commission.percent, commission_value=0.08)
//Backtest dates
start = input(defval = timestamp("08 Mar 2021 00:00 -0600"), title = "Start Time", type = input.time)
finish = input(defval = timestamp("9 Mar 2021 23:59 -0600"), title = "Start Time", type = input.time)
window() => true // create function "within window of time"
// Complete Control over RSI inputs and source price calculations
lengthRSI = input(14, minval=1)
source = input(title="Source", type=input.source, defval=close)
strat = input(title="Strategy", defval="Long/Short", options=["Long Only", "Long/Short", "Short Only"])
strat_val = strat == "Long Only" ? 1 : strat == "Long/Short" ? 0 : -1
stoploss = input(5.00, "Stop Loss %")
oversold= input(30)
overbought= input(60)
// Standard RSI Calculation
RSI = rsi(close, lengthRSI)
stLossLong=(1-(stoploss*.01))
stLossShort=(1+(stoploss*.01))
//Long and Short Strategy Logic
GoLong = crossunder(RSI, oversold) and window()
GoShort = crossover(RSI, overbought) and window()
// Strategy Entry and Exit
if (GoLong)
if strat_val > -1
strategy.entry("LONG", strategy.long)
if strat_val < 1
strategy.close("SHORT")
if (GoShort)
if strat_val > -1
strategy.close("LONG")
if strat_val < 1
strategy.entry("SHORT", strategy.short)
LongStopLoss = barssince(GoLong)<barssince(GoShort) and crossunder(low, valuewhen(GoLong, close, 0)*stLossLong)
ShortStopLoss = barssince(GoLong)>barssince(GoShort) and crossover(high, valuewhen(GoShort, close, 0)*stLossShort)
if (ShortStopLoss)
strategy.close("SHORT")
if (LongStopLoss)
strategy.close("LONG")