Strategi Indeks Momentum Inversi Ganda


Tanggal Pembuatan: 2024-02-06 09:29:34 Akhirnya memodifikasi: 2024-02-06 09:29:34
menyalin: 0 Jumlah klik: 544
1
fokus pada
1617
Pengikut

Strategi Indeks Momentum Inversi Ganda

Ringkasan

Strategi indeks reversibilitas ganda adalah strategi kombinasi antara strategi 123 reversibilitas dan strategi indeks reversibilitas relatif (RMI). Ini bertujuan untuk meningkatkan keakuratan keputusan perdagangan dengan menggunakan sinyal ganda.

Prinsip Strategi

Strategi ini terdiri dari dua bagian:

  1. 123 Strategi Pembalasan

    • Ketika harga penutupan kemarin lebih rendah dari hari sebelumnya, harga penutupan hari ini lebih tinggi dari hari sebelumnya, dan garis Slow K pada hari ke-9 lebih rendah dari 50, lakukan lebih banyak
    • Ketika harga penutupan kemarin lebih tinggi dari hari sebelumnya, harga penutupan hari ini lebih rendah dari hari sebelumnya, dan garis Fast K pada hari ke-9 lebih tinggi dari 50, maka melakukan shorting
  2. Strategi Relatif Mobilitas Indeks (RMI)

    • RMI adalah varian dari faktor momentum yang ditambahkan pada dasar RSI. RMI dihitung dengan rumus: RMI = (SMA atas) / (SMA bawah) * 100
    • Ketika RMI lebih rendah dari over-buy line, lakukan over; ketika RMI lebih tinggi dari over-sell line, lakukan short

Strategi kombinasi ini hanya akan menghasilkan sinyal perdagangan ketika 123 berbalik dan sinyal ganda RMI dikirimkan secara sinkron. Ini dapat secara efektif mengurangi peluang perdagangan yang salah.

Analisis Keunggulan Strategi

Strategi ini memiliki keuntungan sebagai berikut:

  1. Kombinasi dua indikator untuk meningkatkan akurasi sinyal
  2. Menggunakan Strategi Reversal untuk Beradaptasi dengan Gempa
  3. Indikator RMI sensitif, dapat mengidentifikasi titik balik dari tren yang kuat

Analisis Risiko Strategi

Strategi ini juga memiliki beberapa risiko:

  1. Filter ganda akan melewatkan beberapa peluang perdagangan
  2. Sinyal mundur dapat menyebabkan kesalahan penilaian
  3. Setelan parameter RMI yang salah akan mempengaruhi hasil

Risiko ini dapat dikurangi dengan menyesuaikan kombinasi parameter dan mengoptimalkan cara menghitung indikator.

Arah optimasi strategi

Strategi ini juga dapat dioptimalkan dalam beberapa hal:

  1. Uji kombinasi parameter yang berbeda untuk menemukan yang terbaik
  2. Cobalah kombinasi reversal yang berbeda, seperti KDJ, MACD, dan lain-lain.
  3. RMI dirubah agar lebih sensitif
  4. Menambahkan mekanisme stop loss untuk mengendalikan kerugian tunggal
  5. Terkait volume transaksi, hindari sinyal palsu

Meringkaskan

Strategi indeks reversibilitas ganda dengan filter sinyal ganda dan pengoptimalan parameter dapat secara efektif meningkatkan akurasi keputusan perdagangan dan mengurangi probabilitas sinyal yang salah. Ini berlaku untuk situasi yang bergoyang dan dapat mengeksploitasi peluang reversibilitas. Strategi ini dapat meningkatkan efektivitas dan risiko laps lebih lanjut dengan menyesuaikan parameter dan mengoptimalkan cara menghitung indikator.

Kode Sumber Strategi
/*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 )