相対的なモメントインデックス戦略

作者: リン・ハーンチャオチャン, 日付: 2023年11月2日 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より高くなると,市場はオーバー買い,ショート.RMIがBuyZoneより低くなると,市場はオーバー売り,ロング.

利点

  • RSIと比較して,RMIはより敏感で,逆転の機会を早く把握できます.
  • RMIは上昇と低下の勢いを測定し,統合の影響が少ない.
  • 勢いに基づいて RMI は過買い/過売り状態を より良く判断できます

リスク

  • 他の逆転戦略と同様に,RMIは強いトレンドによって停止される危険性があります.ロング信号は破られる可能性があります.
  • RMI パラメータは,異なる製品に最適化する必要があります.そうでなければ結果は不十分かもしれません.
  • 過剰購入/過剰販売の限界値は合理的に設定する必要があります.そうでなければ,誤った信号が多すぎる可能性があります.

ストップ・ロスの拡大,パラメータの最適化,トレンド戦略の組み合わせなどによってリスクは軽減できる.

改善

RMI戦略は,次の側面から改善することができます:

  • リターンを最大化するために Length パラメータを最適化します
  • 誤ったシグナルを減らすために,過買い/過売値値を最適化する.
  • 単一の損失を制御するためにストップ損失を追加します.
  • トレンドフォローや移動平均戦略を組み合わせて 勝率を上げます
  • 安定性を高めるため,製品の特徴に基づいて適切な取引セッションを選択します.

結論

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")

もっと