듀얼 전략: RSI와 확률적 지표 조합 전략


생성 날짜: 2023-10-07 16:19:30 마지막으로 수정됨: 2023-10-07 16:19:30
복사: 0 클릭수: 971
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

개요

이 전략은 상대적으로 약한 지수 ((RSI) 와 무작위 지표의 조합을 사용하여 더 신뢰할 수 있는 거래 신호를 얻기 위해 시장의 과매매 상태를 더 정확하게 판단하기 위해 이중 전략을 형성합니다.

전략 원칙

이 전략에서, RSI는 14주기가 길고, 과도한 구매는 70과 과도한 판매는 30이다. 무작위 지표의 K값은 3주기 평균선으로 계산되며, D값은 K값의 3주기 평균선이다. K선이 아래에서 위로 D선을 돌파할 때 과매매 신호로 판단되며, 반대로 과매매 신호로 판단된다.

이 전략은 RSI 지표와 무작위 지표의 조합을 사용하여 거래 신호를 발송합니다.

  1. 무작위 지표가 상부로 뻗어 있을 때 (K 선이 아래에서 D 선을 통과하는 경우), RSI 지표가 70보다 높을 때, 과매매 신호로 판단하여, 공백을 다.

  2. 무작위적인 지표가 아래로 뚫렸을 때 (K 선이 D 선을 위쪽에서 아래로 뚫고), 동시에 RSI 지표가 30보다 낮을 때, 과매매 신호로 판단하고, 더 많이 한다.

이 이중 조합 전략은 RSI 지표가 과매매를 판단하는 장점을 최대한 활용하고, 무작위 지표의 순차성을 결합하여 가짜 신호를 필터링하여 더 신뢰할 수있는 거래 신호를 생성합니다.

우위 분석

이 두 가지 전략의 가장 큰 장점은 가짜 신호를 효과적으로 줄이고 신호의 신뢰도를 높일 수 있다는 것입니다.

RSI 지표가 단독으로 사용되면 더 많은 가짜 신호가 발생한다. 이것은 RSI 지표 자체가 가격의 초매상태를 판단하기 때문에 트렌드의 방향을 반영할 수 없기 때문이다. 따라서 단독으로 RSI 신호가 더 많다는 것은 신뢰할 수 없다.

랜덤 지표는 가격 트렌드의 방향을 판단할 수 있다. K선에서 D선을 횡단하는 것은 가격의 상승 추세가 지속될 수 있음을 나타냅니다. 이 경우 RSI 초매 신호의 신뢰성이 높으며, 가짜 초매가 아닌 실제 초매로 판단한다.

반대로, K 선이 D 선을 통과하는 것은 가격 추세가 반전될 수 있음을 나타냅니다. RSI가 과매매 신호를 표시하더라도, 가짜 과매매가 될 수도 있습니다.

따라서, RSI와 무작위 지표를 사용하는 조합은 가격의 과매매 상태와 트렌드의 방향을 더 잘 파악할 수 있으며, 신뢰할 수없는 신호를 많이 필터링하여 더 정확한 거래 시간을 얻을 수 있습니다.

위험 분석

이 전략에는 위험도 있습니다.

  1. 이중 지표 조합을 사용하면 가짜 신호를 필터링 할 수 있지만 실제 신호의 일부를 놓칠 수 있으므로 거래 기회를 놓칠 수 있습니다.

  2. RSI와 무작위 지표의 파라미터를 설정하는 것은 RSI 주기가 너무 짧고, 무작위 지표 K, D 값의 부드러움이 부적절하여 신호의 정확성에 영향을 줄 수 있습니다.

  3. 지표가 신호를 발산할 때, 가격 운동, 거래량 등의 요소와 결합하여 확인해야 하며, 가짜 돌파구를 피할 수 있다.

  4. 시스템적 위험에 주의를 기울이고, 시장의 급격한 변동이 있을 때 맹목적인 거래를 피해야 합니다.

최적화 방향

이 전략은 다음과 같은 부분에서 최적화될 수 있습니다.

  1. RSI와 무작위 지표의 파라미터를 최적화하여 최적의 파라미터 조합을 찾습니다. 데이터 재검토를 통해 파라미터를 조정할 수 있으며, 기계 학습 방법을 사용하여 파라미터를 동적으로 최적화 할 수 있습니다.

  2. 거래량 확증 지표, 예를 들어 거래량이 급격히 증가하여 거래 신호를 확인한다.

  3. 이동 평균 등과 같은 트렌드 확인 지표와 결합하여 흔들리는 시장에 끌려가는 것을 피하십시오. 예를 들어, 트렌드가 상승했을 때만 구매 신호를 고려하십시오.

  4. 기계학습을 사용하여 더 복잡한 거래 규칙, 예를 들어 브린 밴드, 가격 형태와 같은 신호를 식별하여 전략의 안정성을 향상시킵니다.

  5. 딥러닝과 같은 최첨단 기술을 활용하여 더 지능적인 다원 거래 시스템을 개발하고, 더 큰 샘플 공간에서 전략 규칙을 최적화한다.

요약하다

이 RSI와 무작위 지표의 이중 조합 전략은 지표 통합의 사고를 통해 각 지표의 장점을 합리적으로 활용하여 상호 보완 효과를 형성한다. 단일 RSI 지표는 더 높은 신호 필터링 정밀도를 가지고 있으며, 따라서 더 정확한 신뢰할 수있는 거래 신호를 얻는다. 그러나 여전히 변수 최적화, 위험 관리와 같은 문제를 주의해야 한다. 이 전략 아이디어는 다른 지표의 조합으로 확대되어 더 효과적인 수량화 거래 전략을 발굴 할 수 있다.

전략 소스 코드
/*backtest
start: 2022-09-30 00:00:00
end: 2023-10-06 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
//Based on Divergences and Hidden Divergences
//Locates bottom market and reversals

strategy("Vix FIX / StochRSI Strategy", pyramiding=9, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=3, overlay=false)

///////////// Stochastic Slow
Stochlength = input(14, minval=1, title="lookback length of Stochastic")
StochOverBought = input(80, title="Stochastic overbought condition")
StochOverSold = input(20, title="Stochastic oversold condition")
smoothK = input(3, title="smoothing of Stochastic %K ")
smoothD = input(3, title="moving average of Stochastic %K")
k = sma(stoch(close, high, low, Stochlength), smoothK)
d = sma(k, smoothD)

 
///////////// RSI 
RSIlength = input( 14, minval=1 , title="lookback length of RSI")
RSIOverBought = input( 70  , title="RSI overbought condition")
RSIOverSold = input( 30  , title="RSI oversold condition")
RSIprice = close
vrsi = rsi(RSIprice, RSIlength)

///////////// Double strategy: RSI strategy + Stochastic strategy

pd = input(22, title="LookBack Period Standard Deviation High")
bbl = input(20, title="Bolinger Band Length")
mult = input(2.0    , minval=1, maxval=5, title="Bollinger Band Standard Devaition Up")
lb = input(50  , title="Look Back Period Percentile High")
ph = input(.85, title="Highest Percentile - 0.90=90%, 0.95=95%, 0.99=99%")
new = input(false, title="-------Text Plots Below Use Original Criteria-------" )
sbc = input(false, title="Show Text Plot if WVF WAS True and IS Now False")
sbcc = input(false, title="Show Text Plot if WVF IS True")
new2 = input(false, title="-------Text Plots Below Use FILTERED Criteria-------" )
sbcFilt = input(true, title="Show Text Plot For Filtered Entry")
sbcAggr = input(true, title="Show Text Plot For AGGRESSIVE Filtered Entry")
ltLB = input(40, minval=25, maxval=99, title="Long-Term Look Back Current Bar Has To Close Below This Value OR Medium Term--Default=40")
mtLB = input(14, minval=10, maxval=20, title="Medium-Term Look Back Current Bar Has To Close Below This Value OR Long Term--Default=14")
str = input(3, minval=1, maxval=9, title="Entry Price Action Strength--Close > X Bars Back---Default=3")
//Alerts Instructions and Options Below...Inputs Tab
new4 = input(false, title="-------------------------Turn On/Off ALERTS Below---------------------" )
new5 = input(false, title="----To Activate Alerts You HAVE To Check The Boxes Below For Any Alert Criteria You Want----")
sa1 = input(false, title="Show Alert WVF = True?")
sa2 = input(false, title="Show Alert WVF Was True Now False?")
sa3 = input(false, title="Show Alert WVF Filtered?")
sa4 = input(false, title="Show Alert WVF AGGRESSIVE Filter?")

//Williams Vix Fix Formula
wvf = ((highest(close, pd)-low)/(highest(close, pd)))*100
sDev = mult * stdev(wvf, bbl)
midLine = sma(wvf, bbl)
lowerBand = midLine - sDev
upperBand = midLine + sDev
rangeHigh = (highest(wvf, lb)) * ph

//Filtered Bar Criteria
upRange = low > low[1] and close > high[1]
upRange_Aggr = close > close[1] and close > open[1]
//Filtered Criteria
filtered = ((wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and (wvf < upperBand and wvf < rangeHigh))
filtered_Aggr = (wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and not (wvf < upperBand and wvf < rangeHigh)

//Alerts Criteria
alert1 = wvf >= upperBand or wvf >= rangeHigh ? 1 : 0
alert2 = (wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and (wvf < upperBand and wvf < rangeHigh) ? 1 : 0
alert3 = upRange and close > close[str] and (close < close[ltLB] or close < close[mtLB]) and filtered ? 1 : 0
alert4 = upRange_Aggr and close > close[str] and (close < close[ltLB] or close < close[mtLB]) and filtered_Aggr ? 1 : 0

//Coloring Criteria of Williams Vix Fix
col = wvf >= upperBand or wvf >= rangeHigh ? lime : gray

isOverBought = (crossover(k,d) and k > StochOverBought) ? 1 : 0
isOverBoughtv2 = k > StochOverBought ? 1 : 0
filteredAlert = alert3 ? 1 : 0
aggressiveAlert = alert4 ? 1 : 0

plot(isOverBought, "Overbought / Crossover", style=line, color=red) 
plot(filteredAlert, "Filtered Alert", style=line, color=fuchsia) 
plot(aggressiveAlert, "Aggressive Alert", style=line, color=orange)

if (filteredAlert or aggressiveAlert)
    strategy.entry("Long", strategy.long)

if (isOverBought)
    strategy.close("Long")