이중 계층 RSI 거래 전략

저자:차오장, 날짜: 2024-01-30 15:21:47
태그:

img

전반적인 설명

더블 데커 RSI 거래 전략은 상대적 강도 지수 (RSI) 를 기반으로 한 양적 거래 전략이다. 이 전략은 빠른 및 느린 RSI를 거래 신호로 사용하여 이중 확인을 달성하고 신호 품질을 개선하고 잘못된 신호를 필터링하는 것을 목표로합니다.

전략 논리

이 전략은 주요 거래 지표로 서로 다른 기간을 가진 두 개의 RSI를 사용합니다. 빠른 RSI는 5 일 기간을 가지고 있으며 단기 과반 구매 및 과반 판매 상황을 포착하는 데 사용됩니다. 느린 RSI는 14 일 기간을 가지고 있으며 중장기 트렌드와 주요 지원 / 저항 수준을 결정하는 데 사용됩니다.

구체적인 거래 규칙은 다음과 같습니다.

  1. 빠른 RSI가 70보다 높고 느린 RSI가 50보다 높을 때, 긴 경로로 이동합니다. 빠른 RSI가 30보다 낮고 느린 RSI가 50보다 낮을 때, 짧은 경로로 이동합니다.

  2. 긴 포지션의 스톱 손실은 빠른 RSI가 55 이하로 넘어가면 발생합니다. 짧은 포지션의 스톱 손실은 빠른 RSI가 45 이상으로 넘어가면 발생합니다.

빠른 및 느린 RSI를 결합함으로써이 전략은 다른 시간 프레임 간의 상호 보완성을 달성하고 중장기 트렌드를 확인하는 동시에 과반 구매 / 과반 판매 조건을 효과적으로 식별하여 고품질의 거래 신호를 생성 할 수 있습니다. 이중 RSI 필터 메커니즘은 또한 잘못된 파업 소음을 줄이는 데 도움이됩니다.

이점 분석

더블 데커 RSI 전략의 가장 큰 장점은 잘못된 신호를 효과적으로 필터링하고 신호 품질을 개선하여 불필요한 거래를 줄이고 거래 빈도를 낮추는 것입니다. 구체적인 장점은 다음과 같습니다.

  1. 빠른 RSI와 느린 RSI의 조합은 단기, 중장기 및 장기간에 걸쳐 과반 구매/ 과반 판매 지점을 식별하여 신호의 정확성을 향상시킵니다.

  2. 이중 RSI 필터 메커니즘은 노이즈를 효과적으로 줄이고 함락되는 것을 피합니다.

  3. 낮은 거래 빈도는 거래 비용과 미끄러짐 손실을 줄이는 데 도움이됩니다.

  4. 스톱 로스 메커니즘은 단일 로스와 최대 드라운을 제어합니다.

위험 분석

더블 데커 RSI 전략은 다음과 같은 측면에서 주로 특정 위험을 초래합니다.

  1. RSI 자체의 지연 특성으로 인해 거래 지연이 발생할 수 있습니다.

  2. 이중 필터 메커니즘은 어떤 거래 기회를 놓칠 수도 있습니다.

  3. 극단적인 시장 조건에서는 시스템 위험을 완전히 피할 수 없습니다.

위의 위험을 완화하기 위해 다음과 같은 방법을 사용할 수 있습니다.

  1. 민감도를 높이기 위해 빠른 RSI의 매개 변수를 적절히 조정합니다.

  2. 리스크와 수익을 균형 잡기 위해 엔트리 및 스톱 로스 조건을 최적화하십시오.

  3. 트렌드 추적 시스템, 머신 러닝 알고리즘 등과 함께 사용

최적화 방향

더블 데커 RSI 전략의 더 이상의 최적화가 여전히 가능하며, 주로 다음과 같은 방향으로:

  1. RSI 매개 변수를 동적으로 최적화하여 시장 조건에 따라 자동으로 조정합니다.

  2. 변동성 기반 리스크 제어 모듈을 추가합니다.

  3. 텍스트 마이닝, 소셜 데이터 등과 같은 대체 신호를 포함합니다.

  4. 신호를 필터링하는 데 도움이 되는 머신러닝 모델을 사용합니다.

위의 최적화를 통해 전략의 수익성, 안정성 및 적응력을 더욱 향상시킬 수 있습니다.

결론

일반적으로, 더블 데커 RSI 전략은 매우 실용적인 양적 거래 전략이다. 트렌드 추적, 과잉 구매/ 과잉 판매 식별, 그리고 이중 필터링 메커니즘을 결합하여 비교적 완전한 거래 시스템을 형성한다. 이 전략은 위험을 제어하고 거래 빈도를 줄이는 데 탁월한 성능을 발휘하여 중장기 보유에 적합하다. 지속적인 최적화와 반복으로, 더블 데커 RSI 전략은 차세대 양적 전략의 중요한 구성 요소가 될 가능성이 있다.


/*backtest
start: 2023-12-30 00:00:00
end: 2024-01-29 00:00:00
period: 1h
basePeriod: 15m
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/
// © Ankit_Quant
//@version=4

// ********************************************************************************************************
// This was coded live during webinar on Backtesting in Tradingview 
// That was held on 16-Jan-21
// Aim of this strategy is to code a Double Decker RSI Strategy - Rules of Strategy are given in Description
// *********************************************************************************************************

// Identifier of strategy or an indicator (study())
strategy(title="Strategy- Double Decker RSI",shorttitle='Strategy - Double Decker RSI',overlay=true)

// ********************
// INPUTS
// ********************
// RSI Lookback Periods
slowRSI=input(defval=14,title='Slow RSI Period',type=input.integer)
fastRSI=input(defval=5,title='Fast RSI Period',type=input.integer)

// Time Period Backtesting Input
start_year=input(defval=2000,title='Backtest Start Year',type=input.integer)
end_year=input(defval=2021,title='Backtest End Year',type=input.integer)

//Specific Years to Test Starategy
timeFilter=true


// Trade Conditions and signals
long = rsi(close,fastRSI)>70 and rsi(close,slowRSI)>50
short = rsi(close,fastRSI)<40 and rsi(close,slowRSI)<50
long_exit=rsi(close,fastRSI)<55
short_exit=rsi(close,fastRSI)>45

//positionSize - 1 Unit (also default setting)
positionSize=1

// Trade Firing - Entries and Exits 
if(timeFilter)
    if(long and strategy.position_size<=0)
        strategy.entry(id='Long',long=strategy.long,qty=positionSize)
    if(short and strategy.position_size>=0)
        strategy.entry(id="Short",long=strategy.short,qty=positionSize)
    if(long_exit and strategy.position_size>0)
        strategy.close_all(comment='Ex')
    if(short_exit and strategy.position_size<0)
        strategy.close_all(comment='Ex')


// Plot on Charts the Buy Sell Labels
plotshape(strategy.position_size<1 and long,style=shape.labelup,location=location.belowbar,color=color.green,size=size.tiny,text='Long',textcolor=color.white)
plotshape(strategy.position_size>-1 and short,style=shape.labeldown,location=location.abovebar,color=color.red,size=size.tiny,text='Short',textcolor=color.white)
plotshape(strategy.position_size<0 and short_exit?1:0,style=shape.labelup,location=location.belowbar,color=color.maroon,size=size.tiny,text='ExShort',textcolor=color.white)
plotshape(strategy.position_size>0 and long_exit?1:0,style=shape.labeldown,location=location.abovebar,color=color.olive,size=size.tiny,text='ExLong',textcolor=color.white)



더 많은