
Sistem penembusan terbalik double overbought adalah strategi kuantitatif yang menggabungkan trend tracking dan perdagangan terbalik. Strategi ini menghasilkan isyarat pembelian dengan mengira sama ada isyarat terbalik berturut-turut berlaku sebelum harga saham ditutup pada hari N sebelum harga saham; dan, dengan mengira purata bergerak T3 untuk parameter tertentu, menghasilkan isyarat jual, untuk melindungi keuntungan.
Strategi ini terdiri daripada dua bahagian:
Menurut buku ini, sistem pembalikan ini melihat perubahan harga penutupan pada hari-hari N yang lalu, dan jika harga penutupan hari ini meningkat dari hari sebelumnya, dan harga penutupan dua hari sebelumnya menurun, ia dianggap sebagai isyarat kenaikan dua hari berturut-turut, dan sistem ini menghasilkan isyarat beli. Selain itu, sistem ini juga akan digabungkan dengan indikator STOCH, jika garis cepat STOCH hari ini lebih rendah daripada garis perlahan, maka lebih lanjut mengesahkan kesahihan isyarat beli.
T3 moving average adalah berdasarkan formula pengiraan tertentu, digabungkan dengan harga indeks moving average dihitung. Ia melalui parameter tertentu, mengatur sensitiviti moving average terhadap perubahan harga. Apabila harga melewati T3 moving average, menghasilkan isyarat menjual.
Strategi ini menggabungkan kedua-dua bahagian isyarat di atas dan menghasilkan isyarat perdagangan yang benar apabila ia memenuhi isyarat beli 123 reversed dan isyarat jual T3 moving average.
Langkah-langkah berikut boleh diambil untuk menangani risiko:
Strategi ini boleh dioptimumkan dalam beberapa aspek:
Anda boleh menambah petunjuk teknikal lain sebagai syarat penapisan berdasarkan strategi asal, seperti syarat penembusan untuk meningkatkan jumlah transaksi, dan sebagainya, untuk mengelakkan perdagangan yang salah yang disebabkan oleh bunyi bising.
Ia boleh diuji dengan pelbagai kombinasi parameter, memilih kombinasi parameter yang sesuai dengan kadar pulangan tertinggi untuk mengoptimumkan kesan strategi. Ia juga boleh menetapkan parameter dinamik, menyesuaikan masa nyata mengikut keadaan pasaran.
Sebagai contoh, ia boleh mengumpul banyak data sejarah, menggunakan model latihan pembelajaran mesin untuk meramalkan masa pembelian dan penjualan yang terbaik.
Ciri-ciri yang berbeza dari pelbagai jenis, parameter yang sesuai juga akan berbeza.
Sistem penembusan terbalik ganda menggabungkan kelebihan trend tracking dan perdagangan terbalik. Ia boleh membeli harga yang lebih rendah pada tahap terbalik dan berhenti tepat pada masanya setelah mengambil keuntungan dari trend. Strategi ini menggabungkan isyarat terbalik dan isyarat trend yang berkesan, dapat memperoleh peluang terbalik dengan berkesan dan mengunci keuntungan. Walaupun masih ada risiko tertentu, ia boleh diperbaiki dengan cara mengoptimumkan parameter, menambah syarat penapis, dan sebagainya untuk menyesuaikan diri dengan keadaan pasaran yang berbeza.
/*backtest
start: 2023-09-26 00:00:00
end: 2023-10-26 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 16/09/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
// This indicator plots the moving average described in the January, 1998 issue
// of S&C, p.57, "Smoothing Techniques for More Accurate Signals", by Tim Tillson.
// This indicator plots T3 moving average presented in Figure 4 in the article.
// T3 indicator is a moving average which is calculated according to formula:
// T3(n) = GD(GD(GD(n))),
// where GD - generalized DEMA (Double EMA) and calculating according to this:
// GD(n,v) = EMA(n) * (1+v)-EMA(EMA(n)) * v,
// where "v" is volume factor, which determines how hot the moving average’s response
// to linear trends will be. The author advises to use v=0.7.
// When v = 0, GD = EMA, and when v = 1, GD = DEMA. In between, GD is a less aggressive
// version of DEMA. By using a value for v less than1, trader cure the multiple DEMA
// overshoot problem but at the cost of accepting some additional phase delay.
// In filter theory terminology, T3 is a six-pole nonlinear Kalman filter. Kalman
// filters are ones that use the error — in this case, (time series - EMA(n)) —
// to correct themselves. In the realm of technical analysis, these are called adaptive
// moving averages; they track the time series more aggres-sively when it is making large
// moves. Tim Tillson is a software project manager at Hewlett-Packard, with degrees in
// mathematics and computer science. He has privately traded options and equities for 15 years.
//
// 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
T3A(Length, b) =>
pos = 0.0
xPrice = close
xe1 = ema(xPrice, Length)
xe2 = ema(xe1, Length)
xe3 = ema(xe2, Length)
xe4 = ema(xe3, Length)
xe5 = ema(xe4, Length)
xe6 = ema(xe5, Length)
c1 = -b*b*b
c2 = 3*b*b+3*b*b*b
c3 = -6*b*b-3*b-3*b*b*b
c4 = 1+3*b+b*b*b+3*b*b
nT3Average = c1 * xe6 + c2 * xe5 + c3 * xe4 + c4 * xe3
pos:= iff(nT3Average > close, -1,
iff(nT3Average < close, 1, nz(pos[1], 0)))
pos
strategy(title="Combo Backtest 123 Reversal & T3 Averages", 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, "---- T3 Averages ----")
LengthT3 = input(5, minval=1)
b = input(0.7, minval=0.01,step=0.01)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posT3A = T3A(LengthT3, b)
pos = iff(posReversal123 == 1 and posT3A == 1 , 1,
iff(posReversal123 == -1 and posT3A == -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 )