双重逆転モメントムインデックス取引戦略

作者: リン・ハーンチャオチャン,日付: 2024-02-06 09:29:34
タグ:

img

概要

ダブルリバーサルモメントインデックス戦略は123リバーサル戦略と相対モメントインデックス (RMI) 戦略を組み合わせたものです.ダブルシグナルを使用して取引決定の正確性を向上させることを目的としています.

戦略原則

戦略は2つの部分からなる.

  1. 123 逆転戦略

    • 昨日の閉店が前日より低く,今日の閉店が前日より高く,9日間のスローKが50未満である場合
    • 昨日の閉店率が前日より高く,今日の閉店率が前日より低く,9日間の速度は50を超えると短くなります.
  2. 相対的なモメントインデックス (RMI) 戦略

    • RMIはRSIの変数で,モメントコンポーネントが加わります.その式は:RMI = (アップアワーモメントSMA) / ((ダウンアワーモメントSMA) *100)
    • RMIが過買いラインより低い場合のロング;RMIが過売りラインより高い場合のショート

この戦略は, 123 リバーサルとRMIが2つのシグナルを一致させるときにのみ取引信号を生成します.これは誤った取引の確率を効果的に減らすことができます.

利点分析

この戦略の利点は以下の通りです.

  1. 双方向表示により信号の精度が向上
  2. 範囲限定市場に適した逆転技術
  3. 強い傾向の転換点を特定するための敏感RMI

リスク分析

リスクもあります:

  1. ダブルフィルターは,いくつかの取引機会を逃すかもしれません.
  2. 逆転シグナルが誤った判断を起こす可能性があります
  3. RMI パラメータの設定が不適切である場合,効率が低下する可能性があります.

これらのリスクは,パラメータを調整し,指標計算を最適化することで軽減できる.

オプティマイゼーションの方向性

戦略は以下によってさらに最適化できます.

  1. 最適値を見つけるために異なるパラメータの組み合わせをテスト
  2. 逆転指標の組み合わせを試す,例えばKDJ,MACD
  3. RMI 公式を調整し,より敏感にする
  4. 単一の損失を制御するためのストップ損失メカニズムの追加
  5. 偽信号を避けるために取引量を組み合わせる

結論

ダブルリバーサルモメントインデックス戦略は,ダブル信号フィルタリングとパラメータ最適化によって,取引決定の正確性を効果的に改善し,誤った信号の確率を減らすことができます.リバーサル機会を明らかにするためにレンジバインド市場に適しています.パラメータを調整し,リスクを下げるために指標計算を最適化し,戦略はさらに強化できます.


/*backtest
start: 2024-01-06 00:00:00
end: 2024-02-05 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 07/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
// 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". 
//
// 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


RMI(Length,BuyZone, SellZone) =>
    pos = 0.0
    xMU = 0.0
    xMD = 0.0
    xPrice = close
    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))) 
    pos

strategy(title="Combo Backtest 123 Reversal & Relative Momentum Index", 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, "---- Relative Momentum Index ----")
LengthRMI = input(20, minval=1)
BuyZone = input(40, minval=1)
SellZone = input(70, minval=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posRMI = RMI(LengthRMI,BuyZone, SellZone)
pos = iff(posReversal123 == 1 and posRMI == 1 , 1,
	   iff(posReversal123 == -1 and posRMI == -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 )

もっと