二重メカニズムを持つ逆転追跡戦略

作者: リン・ハーンチャオチャン,日付: 2024-01-05 15:09:19
タグ:

img

概要

この戦略は,2重メカニズム指標の強みを組み合わせ,逆転信号を決定するために123パターンを使用し,短期的な逆転傾向を把握するために,価格ボリュームインデックスによって動力信号を決定します.

戦略の論理

  1. 123 逆転信号のパターン

    • 9日間のストック・ファースト・ラインとスロー・ラインで

    • 閉じる価格が2日連続で下がり,3日目には上昇し,ストック・ファストラインが50を下回ると,買い信号が生成されます.

    • 閉じる価格が2日連続で上昇し,3日目には下がり,ストック・ファストラインが50を超えると,セール・シグナルが生成されます.

  2. インパクト信号の価格ボリューム指数

    • PVIは,前日と現在の日間のボリューム変化を比較してモメントを判断します.

    • PVIがN日移動平均値を超えると,モメントが増幅され,購入信号が生成されます.

    • PVIがN日移動平均を下回ると,インパクトが低下し,売り信号が生成される.

  3. 2つの信号の組み合わせ

    • 逆転信号とPVIモメント信号が一致するときにのみ取引信号が生成されます.

要するに,この戦略は,二重メカニズム指標の優位性を活用して,短期的な価格・量逆転の機会を効果的に特定します.

利点分析

  1. 123 パターンが重要な短期的な逆転点を捕まえる

  2. PVIの動向は,誤ったブレイクを避けるための調整された価格・量相関行動を判断する

  3. パラメーター最適化 ストック 乱気帯のほとんどのノイズ信号をフィルター

  4. 単一の信号よりも二重信号の信頼性が高い

  5. 日中設計は,短期取引に適した一夜間のリスクを回避する.

リスク分析

  1. 失敗した逆転リスク

    • パターン逆転信号は,常に パターン障害のリスクで成功しない
  2. インディケーターの失敗リスク

    • 株式,PVI,その他の指標は,特定の異常な市場で失敗する可能性があります.
  3. 信号を二重で逃す危険性

    • 比較的厳格な二重信号基準は,単一信号の機会を逃す可能性があります.
  4. 取引頻度の高いリスク

    • 高周波戦略のために,ポジションサイズとリスク管理の厳密な監視が必要です.

最適化方向

  1. 大きいパラメータ最適化空間

    • 窓,ストークのサイクル,PVIなど,最適化スペースを持っています
  2. ストップ・ロスの戦略を組み込むことができる

    • モバイルストップ損失は,勝利率を保証することができます
  3. フィルター条件を追加することを検討

    • テストには移動平均値,波動性フィルターなども追加できます
  4. 二重信号ポートフォリオを最適化

    • 複数の二重指標戦略の組み合わせをテストする

概要

この戦略は,ストックとPVI指標の組み合わせによって,高い信頼性のある短期間の価格・ボリューム逆転システムを形成する.単一指標と比較して,より高い勝利率とポジティブな期待率を持っています. シャープ比率は最適化とリスク管理を通じてさらに改善できます. 結論として,この戦略は,市場における短期間の逆転機会を効果的に把握するために,二重メカニズム指標の強みを活用し,ライブテストと最適化に価値がある.


/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 22/04/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 theory behind the indexes is as follows: On days of increasing volume, 
// you can expect prices to increase, and on days of decreasing volume, you can 
// expect prices to decrease. This goes with the idea of the market being in-gear 
// and out-of-gear. Both PVI and NVI work in similar fashions: Both are a running 
// cumulative of values, which means you either keep adding or subtracting price 
// rate of change each day to the previous day`s sum. In the case of PVI, if today`s 
// volume is less than yesterday`s, don`t add anything; if today`s volume is greater, 
// then add today`s price rate of change. For NVI, add today`s price rate of change 
// only if today`s volume is less than yesterday`s.
//
// 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


PVI(EMA_Len) =>
    pos = 0.0
    xROC = roc(close, 1)
    nRes = 0.0
    nResEMA = 0.0
    nRes := iff(volume > volume[1], nz(nRes[1], 0) + xROC, nz(nRes[1], 0))
    nResEMA := ema(nRes, EMA_Len)
    pos := iff(nRes > nResEMA, 1,
        	 iff(nRes < nResEMA, -1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal & Positive Volume 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, "---- Positive Volume Index ----")
EMA_Len = input(255, minval=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posPVI = PVI(EMA_Len)
pos = iff(posReversal123 == 1 and posPVI == 1 , 1,
	   iff(posReversal123 == -1 and posPVI == -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 )

もっと