RSI 및 평형 RSI 상승적 분산 전략

저자:차오장, 날짜: 2024-03-01 12:11:58
태그:

img

전반적인 설명

이 전략은 RSI 지표와 평형 RSI 지표를 결합하여 가격 바닥에서 구매 기회를 찾습니다. RSI가 새로운 최저치를 만들 때 가격이 새로운 최저치를 만들지 않을 때, 상승적 분산 신호로 간주됩니다. 평형 RSI 트렌드 판단을 추가하면 전략 성능을 향상시킬 수 있습니다.

전략 논리

  1. RSI 표시기를 14개 기간으로 계산합니다.
  2. 평평한 RSI를 평평화 효과를 얻기 위해 WMA의 두 배를 사용하여 계산합니다.
  3. RSI가 30 수준 이하인지 확인해 보세요. 과판 상태입니다.
  4. 평평한 RSI가 35 이하인지 확인해 보세요. 더 강한 방향 추세로요.
  5. RSI의 최저점이 25보다 낮는지 확인하십시오.
  6. RSI 상승차이를 계산하면, RSI가 새로운 하락점을 올리고 가격이 그렇지 않은 것을 찾습니다.
  7. 평형 RSI가 필요 하 고 하락 추세는 3 기간 이상 지속 됩니다.
  8. 위의 모든 조건이 충족되면 구매 신호를 발사합니다.
  9. 손해를 멈추고 수익을 취하는 조건을 설정합니다.

이 전략은 주로 RSI 역전 특성에 의존하며, 평탄한 RSI 트렌드 판단과 결합하여, RSI가 과판되는 동안 가격이 압력을 받으면 구매합니다. 스톱 로스 또는 영업이 닿을 때 포지션을 닫습니다.

이점 분석

  1. 이중 RSI 지표 조합은 전략 성능을 향상시킵니다.
  2. RSI 반전 기능을 이용하면 확률이 높습니다.
  3. 평탄한 RSI 추세 판단은 잘못된 반전을 피하는 데 도움이 됩니다.
  4. 완전한 스톱 로스 및 수익을 취하는 논리는 위험을 제한할 수 있습니다.

위험 분석

  1. RSI 반전 실패의 확률은 완전히 피할 수 없습니다.
  2. 평형 RSI는 지연 효과가 있습니다. 가장 좋은 출입 시기를 놓칠 수 있습니다.
  3. 스톱 로스 설정이 너무 느슨해지면 손실이 커질 위험이 있습니다.

RSI 매개 변수를 조정하여 엔트리 타이밍을 최적화 할 수 있습니다. 더 빠른 중단을 위해 스톱 손실 거리를 강화합니다. 트렌드 위험을 판단하기 위해 다른 지표와 결합하여 잘못된 반전율을 낮추십시오.

최적화 방향

  1. 다른 매개 변수 집합에서 RSI의 시험 효과
  2. 더 나은 평형 품질을 위해 평형 RSI 계산을 개선합니다.
  3. 스톱 로스를 조정하고 이윤 포인트를 취해서 최적의 위험/이익 비율을 찾아보세요.
  4. 저동력 상황을 피하기 위해 운동량 지표 등을 추가합니다.

매개 변수를 조정하고 더 많은 지표를 결합함으로써 전략 성과를 더욱 향상시킵니다.

결론

이 전략은 전체적으로 RSI 반전 특성을 활용합니다. 이중 RSI 조합은 반전 효과를 완전히 활용하면서도 지표의 분차로부터 불확실성을 도입합니다. 이것은 전형적인 지표 전략 아이디어입니다. 끊임없는 테스트와 최적화를 통해 지표 적응력을 향상시킬 수 있습니다. 또한 더 많은 지표를 결합하여 잘못된 판단을 줄이고 견고함을 향상시킵니다.


/*backtest
start: 2024-01-30 00:00:00
end: 2024-02-29 00:00:00
period: 1m
basePeriod: 1m
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/
// © BigBitsIO

//@version=4
strategy(title="RSI and Smoothed RSI Bull Div Strategy [BigBitsIO]", shorttitle="RSI and Smoothed RSI Bull Div Strategy [BigBitsIO]", overlay=true, pyramiding=1, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=.1, slippage=0)


TakeProfitPercent = input(3, title="Take Profit %", type=input.float, step=.25)
StopLossPercent = input(1.75, title="Stop Loss %", type=input.float, step=.25)

RSICurve = input(14, title="RSI Lookback Period", type=input.integer, step=1)
BuyBelowTargetPercent = input(0, title="Buy Below Lowest Low In RSI Divergence Lookback Target %", type=input.float, step=.05)
BuyBelowTargetSource = input(close, title="Source of Buy Below Target Price", type=input.source)
SRSICurve = input(10, title="Smoothed RSI Lookback Period", type=input.integer, step=1)
RSICurrentlyBelow = input(30, title="RSI Currently Below", type=input.integer, step=1)
RSIDivergenceLookback = input(25, title="RSI Divergence Lookback Period", type=input.integer, step=1)
RSILowestInDivergenceLookbackCurrentlyBelow  = input(25, title="RSI Lowest In Divergence Lookback Currently Below", type=input.integer, step=1)
RSISellAbove = input(65, title="RSI Sell Above", type=input.integer, step=1)
MinimumSRSIDownTrend = input(3, title="Minimum SRSI Downtrend Length", type=input.integer, step=1)
SRSICurrentlyBelow = input(35, title="Smoothed RSI Currently Below", type=input.integer, step=1)

PlotTarget = input(false, title="Plot Target")


RSI = rsi(close, RSICurve)
SRSI = wma(2*wma(RSI, SRSICurve/2)-wma(RSI, SRSICurve), round(sqrt(SRSICurve))) // Hull moving average

SRSITrendDownLength = 0
if (SRSI < SRSI[1])
    SRSITrendDownLength := SRSITrendDownLength[1] + 1

// Strategy Specific
ProfitTarget = (close * (TakeProfitPercent / 100)) / syminfo.mintick
LossTarget = (close * (StopLossPercent / 100)) / syminfo.mintick
BuyBelowTarget = BuyBelowTargetSource[(lowestbars(RSI, RSIDivergenceLookback)*-1)] - (BuyBelowTargetSource[(lowestbars(RSI, RSIDivergenceLookback)*-1)] * (BuyBelowTargetPercent / 100))

plot(PlotTarget ? BuyBelowTarget : na)



bool IsABuy = RSI < RSICurrentlyBelow and SRSI < SRSICurrentlyBelow and lowest(SRSI, RSIDivergenceLookback) < RSILowestInDivergenceLookbackCurrentlyBelow and BuyBelowTargetSource < BuyBelowTarget and SRSITrendDownLength >= MinimumSRSIDownTrend and RSI > lowest(RSI, RSIDivergenceLookback)
bool IsASell = RSI > RSISellAbove

if IsABuy
    strategy.entry("Positive Trend", true) // buy by market
    strategy.exit("Take Profit or Stop Loss", "Positive Trend", profit = ProfitTarget, loss = LossTarget)
if IsASell
    strategy.close("Positive Trend")


더 많은