コンボ・モメント・リバース・ダブル・レールマッチング戦略

作者: リン・ハーンチャオチャン, 日付: 2023-11-24 10:17:15
タグ:

img

概要

この戦略は,インパルス逆転とデュアルレールマッチングを実装するために複数の技術指標を組み合わせ,取引信号を生成する.この戦略は,逆転点を決定するために123パターンを使用し,トレンドを追跡するためにエルゴディックCSI指標とシグナルをマッチする.中短期間のトレンドを把握し,高い利益を達成することを目的としています.

原則

この戦略には2つの部分があります.

  1. 123 逆転点を決定するパターン
  2. 対応信号を生成するエルゴジカルCSI指標

123パターンは,最近の3つのバーの閉じる価格に基づいて価格の逆転を判断します. 3番目のバーの閉じる価格が前2つのバーと比較して上昇し,速い株と遅い株の両方が50を下回る場合は,それは購入信号です. 3番目のバーの閉じる価格が前2つのバーと比較して下がり,速い株と遅い株の両方が50を超えると,それは売り信号です.

エルゴジカルCSI指標は,価格,実際の範囲,トレンド指標などの複数の要因を考慮し,市場状況を包括的に決定し,購入/販売ゾーンを生成します. インディケーターが買い区画を超えると 買い信号を生成し 売り区画を下回ると 売り信号を生成します

最後に,Ergodic CSIの123パターンとゾーン信号からの逆転信号は,最終戦略信号を生成するために"ANDED"されます.

利点

  1. 中短期の動向を把握し 高い利益の可能性
  2. 逆転パターンの決定は 転換点を効果的に捉える
  3. 二重レールマッチングは誤信号を減らす

リスク

  1. ストップ・ロスの原因となる 個々のストックは異なる可能性があります.
  2. 範囲限定市場からの影響を受けやすい逆転パターン
  3. パラメータ最適化空間が限られ,パフォーマンス変動が高い

オプティマイゼーションの方向性

  1. 戦略の収益性を向上させるパラメータを最適化
  2. 単一の取引損失を減らすためにストップ損失ロジックを追加
  3. 多要素モデルを導入し,資源の選択を改善する

結論

この戦略は,逆転パターンとデュアルレールマッチングを組み合わせて,中短期間のトレンドを効果的に追跡する.単一の技術指標と比較して,より高い安定性と利益水準を持っています.次のステップは,パラメータをさらに最適化し,ストップ損失とストック選択モジュールを追加し,引き下げを削減し,全体的なパフォーマンスを向上させることです.


/*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 22/07/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
// This is one of the techniques described by William Blau in his book 
// "Momentum, Direction and Divergence" (1995). If you like to learn more, 
// we advise you to read this book. His book focuses on three key aspects 
// of trading: momentum, direction and divergence. Blau, who was an electrical 
// engineer before becoming a trader, thoroughly examines the relationship between 
// price and momentum in step-by-step examples. From this grounding, he then looks 
// at the deficiencies in other oscillators and introduces some innovative techniques, 
// including a fresh twist on Stochastics. On directional issues, he analyzes the 
// intricacies of ADX and offers a unique approach to help define trending and 
// non-trending periods.
// This indicator plots Ergotic CSI and smoothed Ergotic CSI to filter out noise. 
//
// 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

fADX(Len) =>
    up = change(high)
    down = -change(low)
    trur = rma(tr, Len)
    plus = fixnan(100 * rma(up > down and up > 0 ? up : 0, Len) / trur)
    minus = fixnan(100 * rma(down > up and down > 0 ? down : 0, Len) / trur)
    sum = plus + minus 
    100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), Len)

ECSI(r,Length,BigPointValue,SmthLen,SellZone,BuyZone) =>
    pos = 0
    source = close
    K = 100 * (BigPointValue / sqrt(r) / (150 + 5))
    xTrueRange = atr(1) 
    xADX = fADX(Length)
    xADXR = (xADX + xADX[1]) * 0.5
    nRes = iff(Length + xTrueRange > 0, K * xADXR * xTrueRange / Length,0)
    xCSI = iff(close > 0,  nRes / close, 0)
    xSMA_CSI = sma(xCSI, SmthLen)
    pos := iff(xSMA_CSI > BuyZone, 1,
             iff(xSMA_CSI <= SellZone, -1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal & Ergodic CSI", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
r = input(32, minval=1)
LengthECSI = input(1, minval=1)
BigPointValue = input(1.0, minval=0.00001)
SmthLen = input(5, minval=1)
SellZone = input(0.06, minval=0.00001)
BuyZone = input(0.02, minval=0.001)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posECSI = ECSI(r,LengthECSI,BigPointValue,SmthLen,SellZone,BuyZone)
pos = iff(posReversal123 == 1 and posECSI == 1 , 1,
	   iff(posReversal123 == -1 and posECSI == -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 )

もっと