상대적 모멘텀 인덱스 전략

저자:차오장, 날짜: 2023-11-02 17:21:45
태그:

img

전반적인 설명

상대적 모멘텀 인덱스 (RMI) 전략은 모멘텀 인덱스를 기반으로 한 향상된 버전입니다. 역전 기회를 포착하기 위해 시장이 과소매 또는 과소매 여부를 결정하기 위해 기간 동안 가격 모멘텀을 계산합니다.

전략 논리

RMI 계산 공식은 다음과 같습니다.

xMom = xPrice - xPrice[Length]  // Price change over Length periods
xMU = If xMom >= 0: previous xMU minus xMU/Length plus xMom; else: previous xMU
xMD = If xMom <= 0: previous xMD minus xMD/Length plus absolute value of xMom; else: 0 
RM = xMU / xMD
RMI = 100 * (RM / (1 + RM))

먼저 길이 기간 동안의 가격 변화 xMom을 계산합니다. xMom>=0인 경우, 가격이 상승하면 xMU로 축적합니다. xMom<0인 경우, 가격이 하락하면 xMD로 절대 값을 축적합니다. RM은 xMU와 xMD 사이의 비율로 상승과 하락의 모멘텀을 나타냅니다. RMI는 RM을 0-100 범위로 정상화합니다.

RMI가 SellZone보다 높을 때, 시장은 과잉 구매가 되고, short가 됩니다. RMI가 BuyZone보다 낮을 때, 시장은 과잉 판매가 되고, long가 됩니다.

장점

  • RSI와 비교하면 RMI는 더 민감하고 역전 기회를 더 일찍 파악할 수 있습니다.
  • RMI는 상승과 하락의 동력을 측정합니다. 통합에 덜 영향을 받습니다.
  • 모멘텀을 기반으로, RMI는 과잉 구매/ 과잉 판매 상태를 더 잘 결정할 수 있습니다.

위험성

  • 다른 역전 전략과 마찬가지로, RMI는 강한 추세에 의해 중단 될 위험이 있습니다. 긴 신호는 침해 될 수 있습니다.
  • RMI 매개 변수는 다른 제품에 최적화되어야 합니다. 그렇지 않으면 결과는 좋지 않을 수 있습니다.
  • 과잉 매수/ 과잉 판매 한계값은 합리적으로 설정되어야 합니다. 그렇지 않으면 너무 많은 잘못된 신호가 발생할 수 있습니다.

위험은 스톱 로스를 확대하고 매개 변수를 최적화하고 트렌드 전략과 결합하여 줄일 수 있습니다.

개선

RMI 전략은 다음과 같은 측면에서 개선 될 수 있습니다.

  • 최대 반환을 위해 길이 매개 변수를 최적화합니다.
  • 잘못된 신호를 줄이기 위해 과잉 구매/ 과잉 판매 임계치를 최적화합니다.
  • 단일 손실을 제어하기 위해 스톱 손실을 추가합니다.
  • 트렌드를 따라가는 전략이나 이동 평균 전략과 결합하여 승률을 높여줍니다.
  • 안정성을 높이기 위해 제품 특성에 따라 적절한 거래 세션을 선택합니다.

결론

RMI 전략은 가격 동력 변화를 측정함으로써 단기적 인 인퇴 기회를 포착합니다. RSI와 비교하면 RMI는 통합에 더 민감하고 견고합니다. 그러나 중단 될 위험이 있습니다. 매개 변수는 최적화되고 성과를 극대화하기 위해 트렌드 전략과 결합해야합니다.


/*backtest
start: 2023-10-02 00:00:00
end: 2023-10-21 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 19/10/2017
// The Relative Momentum Index (RMI) was developed by Roger Altman. Impressed 
// with the Relative Strength Index's sensitivity to the number of look-back 
// periods, yet frustrated with it's inconsistent oscillation between defined 
// overbought and oversold levels, Mr. Altman added a momentum component to the RSI.
// As mentioned, the RMI is a variation of the RSI indicator. Instead of counting 
// up and down days from close to close as the RSI does, the RMI counts up and down 
// days from the close relative to the close x-days ago where x is not necessarily 
// 1 as required by the RSI). So as the name of the indicator reflects, "momentum" is 
// substituted for "strength".   
//
// You can change long to short in the Input Settings
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
strategy(title="Relative Momentum Index", shorttitle="RMI")
xPrice = close
Length = input(20, minval=1)
BuyZone = input(40, minval=1)
SellZone = input(70, minval=1)
reverse = input(false, title="Trade reverse")
// hline(0, color=gray, linestyle=dashed)
// hline(SellZone, color=red, linestyle=line)
// hline(BuyZone, color=green, linestyle=line)
xMom = xPrice - xPrice[Length]
xMU = iff(xMom >= 0, nz(xMU[1], 1) - (nz(xMU[1],1) / Length) + xMom, nz(xMU[1], 1))
xMD = iff(xMom <= 0, nz(xMD[1], 1) - (nz(xMD[1],1) / Length) + abs(xMom), nz(xMD[1], 0))
RM = xMU / xMD
nRes = 100 * (RM / (1+RM))
pos = iff(nRes < BuyZone, 1,
	   iff(nRes > SellZone, -1, nz(pos[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)	   	    
barcolor(possig == -1 ? red: possig == 1 ? green : blue )  
plot(nRes, color=blue, title="RMI")

더 많은