モメント・リバース・コンボ・戦略

作者: リン・ハーンチャオチャン開催日:2024年01月12日 12:22:47
タグ:

img

概要

この戦略は,123リバース戦略とCMO移動平均戦略を組み合わせて,組み合わせた取引信号を生成する.123リバース戦略は,ストーキャスティックオシレーターからの市場動向に関する判断と組み合わせて,連続2日間の閉店価格から新しい高値または低値を形成することによって,取引信号を生成する.CMO移動平均戦略は,価格動向を決定し,取引信号を生成するためにCMO指標を使用する.両方の戦略からの信号の組み合わせにより,より信頼性の高いコンボ信号を形成することができる.

戦略の論理

123 リバース戦略は,次の論理に基づいて取引信号を生成します.

  1. 閉店価格が2日連続で上昇し 9日ストカスティックオシレーターが50を下回ると ロングにします

  2. 閉店価格が2日連続で下がり 9日ストカスティックオシレーターが50を超えると ショートします

ストカスティックオシレーターの動向の指示と組み合わせて,価格が短期的に新しい高値や低値を形成したかどうかを判断することで,取引信号が生成されます.

CMO移動平均戦略は,次の論理に基づいて取引信号を生成します.

  1. 5,10 日,および 20 日間の CMO 値を計算します.

  2. 平均を取ります

  3. 平均的なCMOが70を超えると 長期化します

  4. 平均CMOが -70を下回ったら ショートにする

戦略は,異なる時間枠のCMO値で総合操作を行うことで,価格動向の方向性を決定し,取引信号を生成します.

コンボ戦略は2つの戦略の信号に対してAND操作を行います. つまり,実際の取引信号は,2つの戦略が同時に購入または販売信号を与える場合にのみ起動します.

利点

この戦略の利点は以下の通りです.

  1. 組み合わせた信号は 誤った信号が少ないので より信頼性があります

  2. 123 逆転戦略は,短期的調整後の傾向を把握する.

  3. CMOの移動平均戦略は,より長い時間枠における勢いを判断します.

  4. 異なる市場環境に適応できる

リスク分析

この戦略のリスクは以下のとおりです.

  1. 123 リバース戦略は価格パターンに大きく依存し,時には失敗する可能性があります.

  2. CMO指標は市場の変動に敏感で,誤った信号を生む可能性があります.

  3. コンボ戦略のシグナルは 過剰に保守的で 取引機会を逃す可能性があります

  4. 適切なパラメータ調整は,異なるサイクルと市場環境に適応するために必要です.

対策は次のとおりです

  1. 逆転戦略のパターン認識ルールを最適化する

  2. CMO移動平均戦略に他の補助指標を追加する.

  3. 最近のパフォーマンスを動的に評価し,パラメータを調整する.

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

この戦略は,次の側面から改善できます.

  1. 機械学習アルゴリズムを使って コンボの重さを自動的に最適化します

  2. パラメータを動的に最適化するために適応調節モジュールを追加します

  3. リスクを効果的に制御するためにストップ・ロスのモジュールを追加します.

  4. 戦略の信頼性を評価し パターン認識アルゴリズムを改善する.

  5. 業界選択,基本要素,その他の要因を考慮する.

結論

この戦略は,2つの高度に互いを補完する戦略 - 123リバースとCMO移動平均から効果的なコンボトレーディングシステムを形成する.適切なリスク管理により,安定したアルファリターンを生むことができる.アルゴリズムとモデルは継続的にアップグレードされるにつれて,この戦略の収益性と安定性がさらに向上すると予想される.


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

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 19/09/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 average of three different length CMO's. This indicator 
//    was developed by Tushar Chande. A scientist, an inventor, and a respected 
//    trading system developer, Mr. Chande developed the CMO to capture what he 
//    calls "pure momentum". For more definitive information on the CMO and other 
//    indicators we recommend the book The New Technical Trader by Tushar Chande 
//    and Stanley Kroll.
//    The CMO is closely related to, yet unique from, other momentum oriented 
//    indicators such as Relative Strength Index, Stochastic, Rate-of-Change, etc. 
//    It is most closely related to Welles Wilder?s RSI, yet it differs in several ways:
//    - It uses data for both up days and down days in the numerator, thereby directly 
//    measuring momentum;
//    - The calculations are applied on unsmoothed data. Therefore, short-term extreme 
//    movements in price are not hidden. Once calculated, smoothing can be applied to 
//    the CMO, if desired;
//    - The scale is bounded between +100 and -100, thereby allowing you to clearly see 
//    changes in net momentum using the 0 level. The bounded scale also allows you to 
//    conveniently compare values across different securities.
//
// 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

CMOav(Length1,Length2,Length3, TopBand, LowBand) =>
    pos = 0
    xMom = close - close[1]
    xMomabs = abs(close - close[1])
    nSum1 = sum(xMom, Length1)
    nSumAbs1 = sum(xMomabs, Length1)
    nSum2 = sum(xMom, Length2)
    nSumAbs2 = sum(xMomabs, Length2)
    nSum3 = sum(xMom, Length3)
    nSumAbs3 = sum(xMomabs, Length3)
    nRes = 100 * (nSum1 / nSumAbs1 + nSum2 / nSumAbs2 + nSum3 / nSumAbs3 ) / 3
    pos := iff(nRes > TopBand, 1,
    	     iff(nRes < LowBand, -1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal & CMOav", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
Length1 = input(5, minval=1)
Length2 = input(10, minval=1)
Length3 = input(20, minval=1)
TopBand = input(70, minval=1)
LowBand = input(-70, maxval=-1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posCMOav = CMOav(Length1,Length2,Length3, TopBand, LowBand)
pos = iff(posReversal123 == 1 and posCMOav == 1 , 1,
	   iff(posReversal123 == -1 and posCMOav == -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 )

もっと