Strategi Arbitrase Rata-rata Bergerak Ganda


Tanggal Pembuatan: 2023-11-24 14:21:06 Akhirnya memodifikasi: 2023-11-24 14:21:06
menyalin: 0 Jumlah klik: 771
1
fokus pada
1621
Pengikut

Strategi Arbitrase Rata-rata Bergerak Ganda

Ringkasan

Strategi ini adalah strategi yang menggunakan bentuk linier ganda untuk melakukan operasi lelang. Ini menggabungkan dua substrategi 123 bentuk reversal dan elemen volume transaksi terbatas ((FVE), untuk melakukan operasi lelang ketika keduanya mengirimkan sinyal beli atau jual pada saat yang sama.

Prinsip Strategi

123 bentuk terbalik

Substrategi ini berasal dari Ulf Jensen dalam bukunya How to Triple Your Profits in the Futures Market. Substrategi ini memberikan sinyal dengan kondisi sebagai berikut:

  • Ketika harga close-out naik 2 hari berturut-turut, dan indikator stoch lambat 9 hari di bawah 50, lakukan lebih banyak;
  • Ketika harga penutupan turun 2 hari berturut-turut, dan indikator stoch cepat di atas 50 pada hari ke-9, lakukan shorting.

Elemen dengan jumlah transisi terbatas (FVE)

FVE adalah indikator volume transaksi murni. Ini menilai apakah uang masuk atau keluar berdasarkan kenaikan harga dan ukuran volume transaksi.

Sinyal ini muncul saat dua bar FVE naik atau turun secara bersamaan.

Analisis Keunggulan

Strategi ini menggabungkan dua indikator untuk menentukan tren pasar dan aliran dana, yang dapat secara efektif menghindari sinyal yang salah. Kedua substrategi ini memiliki karakteristik reversal tertentu, sehingga dapat melakukan operasi lelang untuk mendapatkan keuntungan.

Selain itu, bentuk garis ganda yang sama muncul, mewakili kecenderungan jangka pendek dan menengah yang konsisten, sehingga memiliki stabilitas yang lebih kuat.

Analisis risiko

Strategi ini bergantung pada bentuk garis rata, yang dapat menyebabkan kerugian karena sinyal yang salah muncul ketika pasar bergoyang. Selain itu, risiko kegagalan reversal adalah risiko umum.

Strategi dapat dibuat lebih kuat dengan menyesuaikan parameter yang sesuai, atau Anda dapat mengatur stop loss untuk mengendalikan risiko.

Arah optimasi

Lebih banyak jenis indikator rata-rata dapat diuji untuk mencari kecocokan terbaik. Selain itu, indikator penilaian tambahan seperti indikator kekuatan dan kelemahan, indikator volatilitas, dan lain-lain dapat diperkenalkan untuk menghindari sinyal yang salah.

Selain itu, dapat dipelajari bagaimana menyesuaikan parameter sesuai dengan kondisi pasar yang dinamis, sehingga strategi lebih adaptif. Juga dapat dieksplorasi pembelajaran mesin dan algoritma jaringan saraf untuk mencapai parameter yang beradaptasi.

Meringkaskan

Strategi bi-linear arbitrage ini mengintegrasikan dua indikator untuk membalikkan pola pikir dan dapat menghindari risiko. Namun, karena bergantung pada bentuk garis rata, masih perlu dioptimalkan lebih lanjut untuk membuat strategi lebih stabil. Secara keseluruhan, strategi ini memberikan kerangka dasar untuk perdagangan short-line arbitrage dan layak untuk diteliti lebih lanjut.

Kode Sumber Strategi
/*backtest
start: 2023-10-24 00:00:00
end: 2023-11-23 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 25/08/2020
// 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 FVE is a pure volume indicator. Unlike most of the other indicators 
// (except OBV), price change doesn?t come into the equation for the FVE (price 
// is not multiplied by volume), but is only used to determine whether money is 
// flowing in or out of the stock. This is contrary to the current trend in the 
// design of modern money flow indicators. The author decided against a price-volume 
// indicator for the following reasons:
// - A pure volume indicator has more power to contradict.
// - The number of buyers or sellers (which is assessed by volume) will be the same, 
//     regardless of the price fluctuation.
// - Price-volume indicators tend to spike excessively at breakouts or breakdowns.
//
// 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


FVE(Period,Factor) =>
    pos = 0
    nRes = 0.0
    xhl2 = hl2
    xhlc3 = hlc3
    xClose = close
    xVolume = volume
    xSMAV = sma(xVolume, Period)
    nMF = xClose - xhl2 + xhlc3 - xhlc3[1]
    nVlm = iff(nMF > Factor * xClose / 100,  xVolume, 
             iff(nMF < -Factor * xClose / 100, -xVolume, 0))
    nRes := nz(nRes[1],0) + ((nVlm / xSMAV) / Period) * 100
    pos := iff(nRes > nRes[1] and nRes > nRes[2], 1,
             iff(nRes < nRes[1] and nRes < nRes[2], -1, nz(pos[1], 0)))   
    pos

strategy(title="Combo Backtest 123 Reversal & Finite Volume Elements (FVE)", shorttitle="Combo", overlay = true)
Length = input(15, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
Period = input(18, minval=1)
Factor = input(0.6, minval=0.1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posFVE = FVE(Period,Factor)
pos = iff(posReversal123 == 1 and posFVE == 1 , 1,
	   iff(posReversal123 == -1 and posFVE == -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 )