トレンド逆転とエラーズの主要指標コンボ戦略

作者: リン・ハーンチャオチャン, 日付: 2023年11月7日 16:10:26
タグ:

img

概要

この戦略は,トレンド逆転戦略とエーラーズの主要指標戦略を組み合わせて,より信頼性の高い取引信号を生成する.トレンド逆転戦略はトレンド逆転ポイントを特定し,エーラーズの主要指標戦略は周期的なターニングポイントを特定する.組み合わせたシグナルにより市場へのエントリータイミングがよりよく決定できます.

戦略の論理

トレンド逆転戦略

この戦略は,ウルフ・ジェンセン著の"How I Tripped My Money in the Futures Market"の183ページから引用されています.これは逆転型戦略です. 閉店が2日連続で前の閉店よりも高く,9日ストコスタスススローラインが50を下回るとロングになります. 閉店が2日連続で前の閉店より低く,9日ストコスタスススフASTラインが50以上になるとショートになります.

エーラーズの主要指標戦略

この戦略は,日中のデータを使用して,単一の日々のデトロンド合成価格 (DSP) と日々のエーラーズ主要指標 (ELI) をプロットする.DSPは支配的な価格サイクルを把握し,2ポールフィルターから3ポールバターワースフィルターを引くことで計算される.ELIは周期的なターニングポイントの先行指示を与え,DSP自体にDSPの単純な移動平均を引くことで計算される.ELIがDSPを超えたり下回ったときに購入・販売信号が生成される.

利点分析

このコンボ戦略の最大の利点は,より信頼性の高いシグナルのためにトレンド逆転の識別とサイクリックターニングポイントの検出を組み合わせることです.トレンド逆転戦略はブレイクアウト後の逆転を特定し,エーラーズ主要指標はサイクリック低値と高値の早期表示を提供します.両方を組み合わせることで,市場への入入力をより正確に特定することができます.

ストキャスト指標のパラメータは,市場状況に基づいて調整することができる.エーラーズ主要指標のサイクル長さは,異なるサイクルにも調整可能である.

リスク分析

この戦略の最大のリスクは,持続するトレンドを逃すことである. 戦略は逆転信号が入ってくるのを待つため,強い初期トレンド動きを見逃す可能性があります.逆転信号は,罠に囚われる結果の偽のブレイクであることが判明する可能性があります.

解決策は,トレンド逆転をタイムリーに把握するために逆転検出期間を短縮するためにパラメータを調整することです.ストップ損失は,損失を制御するために導入することもできます.

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

戦略は以下の点で改善できる:

  1. ストップ・ロスを導入して 単一の取引損失を制御します

  2. パラメータを最適化して,異なる市場環境に逆転信号期間を調整する.

  3. 信号の質を向上させ 偽信号を減らすために他の指示フィルターを追加します.

  4. ポジションサイズとリスク管理モジュールを追加する.

  5. テストパラメータを異なる製品でテストし,最適化されたフィットを見つけます.

  6. マシン学習モジュールを追加します

概要

この戦略は,より信頼性の高い市場参入のためにトレンド逆転と周期的なターニングポイント検出を組み合わせます.最大の利点は高い信号品質と柔軟性です.主なリスクは,パラメータチューニングとストップ損失によって緩和できる早期トレンドが欠けていることです.将来の改善は,ストップ損失,パラメータ最適化,信号フィルタリングなどに焦点を当てて,市場環境全体で戦略を堅牢にすることができます.


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

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 26/11/2019
// 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 a single
// Daily DSP (Detrended Synthetic Price) and a Daily ELI (Ehlers Leading
// Indicator) using intraday data.
// Detrended Synthetic Price is a function that is in phase with the dominant
// cycle of real price data. This one is computed by subtracting a 3 pole Butterworth
// filter from a 2 Pole Butterworth filter. Ehlers Leading Indicator gives an advanced
// indication of a cyclic turning point. It is computed by subtracting the simple
// moving average of the detrended synthetic price from the detrended synthetic price.
// Buy and Sell signals arise when the ELI indicator crosses over or under the detrended
// synthetic price.
// See "MESA and Trading Market Cycles" by John Ehlers pages 64 - 70. 
//
// 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

D_ELI(Length) =>
    pos = 0.0
    xHL2 = security(syminfo.tickerid, 'D', hl2)
    xEMA1 = ema(xHL2, Length)
    xEMA2 = ema(xHL2, 2 * Length)
    xEMA1_EMA2 = xEMA1 - xEMA2
    xResultEMA = ema(xEMA1_EMA2, Length)
    nRes = xEMA1_EMA2 - xResultEMA
    pos:= iff(nRes > 0, 1,
	       iff(nRes < 0, -1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal & D_ELI (Ehlers Leading Indicator)", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
LengthELI = input(7, minval=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posD_ELI = D_ELI(LengthELI)
pos = iff(posReversal123 == 1 and posD_ELI == 1 , 1,
	   iff(posReversal123 == -1 and posD_ELI == -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 )

もっと