多要素モメンタム逆転コンボ戦略

作者: リン・ハーンチャオチャン, 日付: 2023-11-21 11:20:31
タグ:

img

概要

この戦略は,市場における逆転機会を発見するために逆転因子と動力因子を組み合わせる多要素コンボ戦略である.この戦略は,まず,範囲内下落後の逆転機会を特定するために長期逆転因子を使用し,その後,短期の逆転仲介機会をロックするために,主要なトレンドの下で偽の逆転信号をフィルタリングするために二次スクリーニングのための動力指標を使用する.

戦略の論理

戦略は2つの部分からなる.

  1. 123 逆転因数

    この部分は,前日の閉店価格と2日前の閉店価格との関係を決定するために,日中の逆転の考え方を用いて,K線が遅い逆転の機会を特定します.具体的な論理は:

    • 購入信号: 閉店価格が2日連続で下がった後,当日の閉店価格が上昇し,9日間のスローKラインが50を下回ると,購入信号が生成されます.

    • セールシグナル: 閉店価格が2日連続で上昇し,当日の閉店価格が下がり,9日間のK線が50を超えるとセールシグナルが生成されます.

  2. エラーズ・ダイナミック・モメント・オシレーター (ETSI)

    この部分では,EMAの3つのスムージング価格モメントメソッドを用いてモメントインジケーターを構築する.インジケーターの式は以下のとおりです.

    xPrice1 = close - close[1]
    xPrice2 = abs(close - close[1]) 
    xSMA_R = EMA(EMA(EMA(xPrice1,r), s), u)
    xSMA_aR = EMA(EMA(EMA(xPrice2, r), s), u) 
    xTSI = xSMA_R / xSMA_aR * 100
    xEMA_TSI = EMA(xTSI, N)
    

    xSMA_Rは価格動力のEMAスムーズ値,xSMA_aRは価格変動のEMAスムーズ値,xTSIは両者の比率から構築されたモメント指標,xEMA_TSIはxTSIの二次EMAスムーズ値である.この指標は,xTSIとxEMA_TSIの関係に基づいて取引信号の方向性を決定する.

最後に,この戦略は2つの要素からの信号と一致し,両方の要素からの信号が一致するときにのみ実際の取引注文を発行します.

戦略 の 利点

この戦略の最大の利点は,誤った信号をフィルターし,高品質な取引機会を発見できる多要素設計にあります.特に,以下の3つのポイントがあります.

  1. 123の逆転因子は,範囲内での減少の後,短期的なリバウンドポイントを特定することができます.

  2. エーラーズモメントインジケーターは,主要なトレンド下で発生する逆転信号を避けるために,主要なトレンドの方向性を効果的に決定し,誤った信号をフィルタリングすることができます.

  3. 2つの信号部分の AND 操作は信号の質を向上させ,戦略の安定性を高めることができます.

戦略 の リスク

戦略はリスク管理のための多要素設計を採用しているが,依然として以下の主要なリスクがある.

  1. 振動するトレンドでは逆転信号が現れ,利益を得ることができません.

  2. この2つの要素のパラメータ設定には主観性があり,特定の製品に過剰に適合する可能性があります.

  3. 価格逆転後に損失が増えるリスクは再び逆転する.

これらのリスクは,より多くの種類に適応するためのパラメータの最適化,逆転後のポジションの制御,指標関係の変化のリアルタイムモニタリング,その他の手段によって軽減できます.

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

この戦略を最適化するための主な側面は以下の通りである.

  1. 2つの要素のパラメータを調整し,よりよく一致するデータサンプルを見つけます

  2. ストップ・ロスの戦略を増やして 単一の損失を制御する

  3. トレンドと振動の多様性に対して異なるパラメータの組み合わせを使用する.

  4. より良いパフォーマンスの要素により大きな重みを与えるため,要因の重み付けメカニズムを増やす.

  5. 自動最適化とパラメータの更新を達成するために機械学習アルゴリズムを増やす.

結論

この戦略は,反転因子と動量指標をうまく組み合わせ,多要素最適化設計を達成する.短期的な反転機会を効果的に特定し,動量指標を使用してシグナルを二次検証し,戦略の勝利率を向上させる.戦略にはまだ改善の余地があるが,その基本的なアイデアは定量戦略の設計のための良い参照を提供します.


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

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 30/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
// r - Length of first EMA smoothing of 1 day momentum        4
// s - Length of second EMA smoothing of 1 day smoothing      8    
// u- Length of third EMA smoothing of 1 day momentum         6  
// Length of EMA signal line                                  3
// Source of Ergotic TSI                                      Close
//
// 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.  
//
// 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


ETSI(r,s,u,SmthLen) =>
    pos = 0
    xPrice = close
    xPrice1 = xPrice - xPrice[1]
    xPrice2 = abs(xPrice - xPrice[1])
    xSMA_R = ema(ema(ema(xPrice1,r), s),u)
    xSMA_aR = ema(ema(ema(xPrice2, r), s),u)
    Val1 = 100 * xSMA_R
    Val2 = xSMA_aR
    xTSI = iff (Val2 != 0, Val1 / Val2, 0)
    xEMA_TSI = ema(xTSI, SmthLen)
    pos:= iff(xTSI > xEMA_TSI, 1,
    	   iff(xTSI < xEMA_TSI, -1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal & Ergodic TSI", 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(4, minval=1)
s = input(8, minval=1)
u = input(6, minval=1)
SmthLen = input(3, minval=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posETSI = ETSI(r,s,u,SmthLen)
pos = iff(posReversal123 == 1 and posETSI == 1 , 1,
	   iff(posReversal123 == -1 and posETSI == -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 )

もっと