Strategi kuantitatif berayun yang dipacu trafik


Tarikh penciptaan: 2023-12-05 11:35:50 Akhirnya diubah suai: 2023-12-05 11:35:50
Salin: 0 Bilangan klik: 763
1
fokus pada
1619
Pengikut

Strategi kuantitatif berayun yang dipacu trafik

Ini adalah strategi perdagangan berdasarkan Klinger kuantitatif indikator. Strategi ini menangkap perubahan dalam harga turun naik kekuatan jual beli untuk mencari titik-titik perubahan trend pasaran. Kelebihannya adalah sensitif dan tepat, boleh digunakan untuk analisis jangka pendek dan jangka panjang.

Prinsip Strategi

Strategi ini berdasarkan kepada teori berikut:

  1. Julat harga ((harga tertinggi - harga terendah) mencerminkan kelajuan turun naik harga, manakala jumlah transaksi adalah penggerak turun naik harga.
  2. Harga tertinggi + harga terendah + harga penutupan hari dan jumlah hari sebelumnya, menunjukkan peningkatan kekuatan pembeli, ciri akumulasi; sebaliknya adalah ciri peruntukan.
  3. Perkembangan berterusan dalam jumlah transaksi mencerminkan perubahan dalam kekuatan kedua-dua pihak.

Berdasarkan teori-teori ini, strategi ini menggunakan perbandingan antara jumlah harga penutupan dengan saiz hari sebelumnya, menggabungkan perubahan jumlah dagangan, dan mengira Klinger kuantitatif. Apabila indikator melintasi garis rata-rata sendiri, lakukan lebih banyak, dan apabila melintasi garis rata-rata, lakukan kosong.

Secara khusus, strategi ini mengandungi tiga indikator:

  1. xTrend: menunjukkan kekuatan pergerakan harga, berdasarkan perbandingan harga akhir hari dengan hari sebelumnya.
  2. xFast: garis purata pantas xTrend dengan parameter 34 hari.
  3. xSlow: garis purata kelajuan perlahan xTrend, parameter 55 hari。

Kemudian mengira perbezaan nilai xKVO sebagai penunjuk perdagangan. Apabila ia melepasi 13 hari rata-rata xTrigger, lakukan lebih banyak, dan apabila ia melepasi kosong.

Kelebihan Strategik

Kelebihan terbesar strategi ini adalah ia sesuai untuk analisis jangka pendek dan jangka panjang. Pengaturan parameter untuk garis rata-rata perlahan-lahan membolehkan ia menangkap perubahan trend jangka pendek dengan sensitif. Pada masa yang sama, ia juga dapat menyaring kebisingan pasaran jangka pendek dan menangkap trend jangka panjang.

Di samping itu, strategi ini hanya berdasarkan harga dan pengiraan jumlah transaksi. Tidak perlu mengira petunjuk matematik yang rumit, pengiraan yang cekap, sesuai untuk aplikasi desktop.

Risiko dan tindakan pencegahan

Risiko terbesar strategi ini adalah bahawa penunjuk kuantiti urus niaga lemah dalam mengesan pecah palsu. Strategi ini mungkin menghantar isyarat melakukan yang salah apabila terdapat penyesuaian jangka pendek ke atas untuk menembusi garis purata.

Di samping itu, strategi ini lebih sensitif kepada parameter yang ditetapkan. Parameter untuk rata-rata laju dan rata-rata perdagangan perlu diuji dan dioptimumkan berulang kali untuk mendapatkan prestasi terbaik.

Pengoptimuman Strategi

Berdasarkan analisis risiko, kami dapat mengoptimumkan lagi strategi ini dalam beberapa aspek:

  1. Menambah mekanisme hentikan kerugian. Hentikan kerugian keluar apabila harga jatuh pada satu peratusan, dapat mengurangkan gangguan bunyi untuk penyesuaian jangka pendek.

  2. Menambah penapis trend. Menggabungkan indeks seperti MACD dan penunjuk purata bergerak untuk menilai pergerakan keseluruhan pasaran, dan mengelakkan kehilangan arah dalam keadaan goyah.

  3. Pengaturan parameter yang dioptimumkan. Mencari kombinasi parameter terbaik melalui data retest sejarah untuk meningkatkan kestabilan strategi.

  4. Pengurusan wang pra-peranan optimum. Sebagai contoh, menyesuaikan kedudukan secara dinamik mengikut situasi menang dan rugi.

ringkaskan

Strategi ini menangkap perubahan kekuatan jual beli pasaran dengan membandingkan hubungan jumlah harga dan jumlah transaksi, sambil mempertimbangkan sensitiviti dan kestabilan. Prestasi yang baik boleh diperoleh dengan menetapkan parameter pengoptimuman dan menggabungkan penghakiman trend. Tetapi pedagang masih perlu waspada terhadap risiko yang dibawa oleh batasan indikator itu sendiri.

||

This is a trading strategy based on the Klinger Volume Oscillator. It captures the shifts in buying and selling forces during price fluctuations to identify turning points in market trends. The advantages are sensitivity and accuracy for both short-term and long-term analysis. However, some risks need to be noticed.

Strategy Logic

The strategy is built on the following assumptions:

  1. The price range (high-low) reflects the amplitude of price swings, while volume is the driving force behind price movements.
  2. If today’s sum of high + low + close is greater than yesterday’s, it indicates strengthened buying forces and accumulation; the opposite suggests distribution.
  3. Continuous changes in volume reflect shifts in the forces of buyers and sellers.

Based on the theories, the strategy calculates the Klinger Volume Oscillator by comparing the relationship between today’s sum of closing prices and yesterday’s, combined with changes in volume. It goes long when the indicator crosses above its moving average line, and goes short on crosses below.

Specifically, there are three main indicators involved:

  1. xTrend: reflects the force of price trend based on comparison of sum of prices between days.
  2. xFast: fast EMA of xTrend with period of 34.
  3. xSlow: slow EMA of xTrend with period of 55.

The difference xKVO is then calculated as the trading indicator. Go long on crossing above 13-day EMA xTrigger, and short on crossing below.

Advantages

The greatest advantage is being suitable for both short-term and long-term analysis simultaneously. The fast and slow EMA settings make it sensitive to catch short-term swings, while also filtering out market noise and capturing long-term trends, which most price-based indicators struggle with.

In addition, it is purely based on price and volume data without complex math. This makes it highly efficient for actual trading applications.

Risks & Solutions

The main risk is weaker ability to distinguish false breakouts. Short-term price adjustments may generate wrong long signals. Other factors should be considered to determine the trend.

Also, the strategy is sensitive towards parameter tuning. Optimization is required on the EMAs and trigger line to find best performance.

Strategy Optimization

Some aspects that could further optimize the strategy according to the risks:

  1. Add stop loss mechanisms. Exiting at some percentage retracement reduces noise interference.

  2. Add trend filtering with indicators like MACD to avoid directional mistakes in ranging markets.

  3. Optimize parameter sets through backtests to improve robustness.

  4. Capital management optimization such as dynamic position sizing based on stop loss/take profit levels.

Conclusion

Overall, the strategy captures shifts in market forces by comparing price quantities and volumes for both sensitivity and stability. It can perform well given optimized parameters and trend validation, but inherent limitations of volume indicators can still pose risks for traders.

[/trans]

Kod sumber strategi
/*backtest
start: 2022-11-28 00:00:00
end: 2023-12-04 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 30/08/2017
// The Klinger Oscillator (KO) was developed by Stephen J. Klinger. Learning 
// from prior research on volume by such well-known technicians as Joseph Granville, 
// Larry Williams, and Marc Chaikin, Mr. Klinger set out to develop a volume-based 
// indicator to help in both short- and long-term analysis.
// The KO was developed with two seemingly opposite goals in mind: to be sensitive 
// enough to signal short-term tops and bottoms, yet accurate enough to reflect the 
// long-term flow of money into and out of a security.
// The KO is based on the following tenets:
// Price range (i.e. High - Low) is a measure of movement and volume is the force behind 
// the movement. The sum of High + Low + Close defines a trend. Accumulation occurs when 
// today's sum is greater than the previous day's. Conversely, distribution occurs when 
// today's sum is less than the previous day's. When the sums are equal, the existing trend 
// is maintained.
// Volume produces continuous intra-day changes in price reflecting buying and selling pressure. 
// The KO quantifies the difference between the number of shares being accumulated and distributed 
// each day as "volume force". A strong, rising volume force should accompany an uptrend and then 
// gradually contract over time during the latter stages of the uptrend and the early stages of 
// the following downtrend. This should be followed by a rising volume force reflecting some 
// accumulation before a bottom develops.
//
// You can change long to short in the Input Settings
// Please, use it only for learning or paper trading. 
////////////////////////////////////////////////////////////
strategy(title="Klinger Volume Oscillator (KVO)", shorttitle="KVO")
TrigLen = input(13, minval=1)
FastX = input(34, minval=1)
SlowX = input(55, minval=1)
reverse = input(false, title="Trade reverse")
hline(0, color=gray, linestyle=line)
xTrend = iff(hlc3 > hlc3[1], volume * 100, -volume * 100)
xFast = ema(xTrend, FastX)
xSlow = ema(xTrend, SlowX)
xKVO = xFast - xSlow
xTrigger = ema(xKVO, TrigLen)
pos = iff(xKVO > xTrigger, 1,
	   iff(xKVO < xTrigger, -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(xKVO, color=blue, title="KVO")
plot(xTrigger, color=red, title="Trigger")