이중 역전 RSI 모멘텀 전략

저자:차오장, 날짜: 2023-09-26 15:42:48
태그:

전반적인 설명

이 전략은 트렌드 반전 지점에서 높은 확률의 엔트리를 위한 신호를 필터링하기 위해 123 반전 패턴과 RSI 추진력 전략을 결합합니다.

원칙

123 역전 전략

이 전략 은 울프 젠센 의 책 How I Tripled My Money in the Futures Market, 183. 페이지 에서 따온 것 이다. 이 책 은 통합 도중 잠재적 인 트렌드 반전 을 식별 한다.

특히, 닫기가 2일 연속으로 이전 닫기보다 높고, 9주기 느린 K 라인이 50보다 낮을 때 긴 라인이 되고, 닫기가 2일 연속으로 이전 닫기보다 낮고, 9주기 빠른 K 라인이 50보다 높을 때 짧은 라인이 된다.

그래서 본질적으로 그것은 잠재적인 반전을 결정하기 위해 스토카스틱 지표의 황금 십자가와 죽음의 십자가를 사용합니다.

RSI 모멘텀 전략

이 전략은 ROC 함수를 사용하여 가격 변화율을 계산하고, 가격 변화율에 기반한 RSI 지표를 구성하여 동력 추세를 결정합니다.

RSI가 구매 구역 아래에 있을 때 길게, 상승 동력을 가속화하는 것을 나타냅니다. RSI가 판매 구역 위에 있을 때 짧게, 하락 동력을 가속화하는 것을 나타냅니다.

장점

  • 123 회전 패턴은 통합 후의 잠재적 회전 지점을 식별합니다.
  • RSI 동력은 가짜 브레이크를 효과적으로 필터링합니다.
  • 양쪽 전략의 신호의 축적은 높은 확신의 항목을 제공합니다.

위험성

  • 123 패턴은 황소 함정이나 거짓 탈출에 유연하며 필터링이 필요합니다.
  • RSI는 여전히 가격에 기반을두고 있으며, 완전히 휘프사우를 피할 수 없습니다.
  • 이중 신호 축적은 더 나은 입구점을 놓칠 수 있습니다.

위험을 줄일 수 있는 방법:

  1. 트렌드를 정의하기 위해 더 긴 기간을 사용하는 스토카스틱 매개 변수를 조정합니다.
  2. 더 넓은 구매/판매 영역을 사용하도록 RSI 매개 변수를 조정합니다.
  3. 항목에 대해 하나의 신호만 사용하는 것을 고려하십시오.

최적화 방향

  • 특정 제품에 대한 최적 값을 찾기 위해 ROC 기간을 테스트하십시오.
  • 123 패턴 논리를 테스트, 예를 들어 빠른 / 느린 K 라인을 조정
  • 최적의 구매/판매 범위를 찾기 위해 RSI 구역 값을 테스트합니다.
  • MACD와 같은 다른 지표로 스토카스틱을 대체해보세요.
  • 하나의 전략 신호만 사용하는 테스트 효과

결론

이 전략은 트렌드 반전에서 두 개의 확인 반전 신호를 요구함으로써 입력 정확성을 향상시킵니다. 123 패턴은 반전을 식별하고 RSI 모멘텀은 유효성을 확인합니다. 다른 제품 및 선호도에 대한 매개 변수를 최적화하기가 쉽습니다. 그러나 이중 신호 축적에서 빠진 항목을 조심하십시오. 전반적으로 반전 트렌드를 식별하는 효과적인 프레임 워크입니다.


/*backtest
start: 2023-08-26 00:00:00
end: 2023-09-25 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 17/06/2021
// This is combo strategies for get a cumulative signal. 
//
// First strategy
// This System was created from the Book "How I Tripled My Money In The 
// Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
// The strategy buys at market, if close price is higher than the previous close 
// during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50. 
// The strategy sells at market, if close price is lower than the previous close price 
// during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
//
// Second strategy
// This is the new-age indicator which is version of RSI calculated upon 
// the Rate-of-change indicator.
// The name "Relative Strength Index" is slightly misleading as the RSI 
// does not compare the relative strength of two securities, but rather 
// the internal strength of a single security. A more appropriate name 
// might be "Internal Strength Index." Relative strength charts that compare 
// two market indices, which are often referred to as Comparative Relative Strength.
// And in its turn, the Rate-of-Change ("ROC") indicator displays the difference 
// between the current price and the price x-time periods ago. The difference can 
// be displayed in either points or as a percentage. The Momentum indicator displays 
// the same information, but expresses it as a ratio.
//
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
Reversal123(Length, KSmoothing, DLength, Level) =>
    vFast = sma(stoch(close, high, low, Length), KSmoothing) 
    vSlow = sma(vFast, DLength)
    pos = 0.0
    pos := iff(close[2] < close[1] and close > close[1] and vFast < vSlow and vFast > Level, 1,
	         iff(close[2] > close[1] and close < close[1] and vFast > vSlow and vFast < Level, -1, nz(pos[1], 0))) 
	pos


RSI_ROC(RSILength,ROCLength,BuyZone,SellZone) =>
    pos = 0.0
    xPrice = close
    nRes = rsi(roc(xPrice,ROCLength),RSILength)
    pos := iff(nRes < BuyZone, -1,
	         iff(nRes > SellZone, 1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal & RSI based on ROC", shorttitle="Combo", overlay = true)
line1 = input(true, "---- 123 Reversal ----")
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
line2 = input(true, "---- RSI based on ROC ----")
RSILength = input(20, minval=1)
ROCLength = input(20, minval=1)
BuyZone = input(30, minval=1)
SellZone = input(70, minval=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posRSI_ROC = RSI_ROC(RSILength,ROCLength,BuyZone,SellZone)
pos = iff(posReversal123 == 1 and posRSI_ROC == 1 , 1,
	   iff(posReversal123 == -1 and posRSI_ROC == -1, -1, 0)) 
possig = iff(reverse and pos == 1, -1,
          iff(reverse and pos == -1 , 1, pos))	   
if (possig == 1 ) 
    strategy.entry("Long", strategy.long)
if (possig == -1 )
    strategy.entry("Short", strategy.short)	 
if (possig == 0) 
    strategy.close_all()
barcolor(possig == -1 ? #b50404: possig == 1 ? #079605 : #0536b3 )

더 많은