ダブルインバージョンCMOクォンタム戦略


作成日: 2024-01-04 14:35:23 最終変更日: 2024-01-04 14:35:23
コピー: 0 クリック数: 557
1
フォロー
1621
フォロワー

ダブルインバージョンCMOクォンタム戦略

概要

この策略は,双反転策略であり,123反転指標とCMOWMA量子指標を組み合わせ,価格反転信号の双重確認を実現し,赤緑色のK線視覚効果を有する.

戦略原則

戦略は2つの部分から構成されています.

  1. 123 逆転指数

    • 閉店価格と昨日の閉店価格の大きさの関係を使用して,価格の上昇または低下を判断する
    • ストキャスティック指標の快線と遅線の交差を用い,反転信号を確認する
    • 条件を満たしたときに多量または空白の信号を生成する
  2. CMOWMA量子指標

    • CMO指標を用いて価格動態を測定する
    • CMO指数に対するWMA重引移動平均
    • CMO指数は,WMAの値が,CMO指数より高い (以下) と,CMO指数が,WMAの値が,CMO指数より高い (以下) と,CMO指数が,WMAの値が,CMO指数より低い (以下) と見積もられている.

信号の2つの部分は同方向にポジションに入ります.

戦略的優位性

  1. ダブル認証メカニズムで,不正取引をフィルタリングし,無意味なポジションを減らす
  2. 赤い緑のK線で,視覚的な効果が生まれ,市場状況を容易に判断できる.
  3. 反転と運動量指標の組み合わせを用いて,全体的な安定性が良好
  4. シンプルなパラメータ設定,多種多様で,実行しやすい

戦略リスク

  1. 逆転後にも逆転する可能性があるため,尾張りの危険性がある.
  2. ポジションを頻繁に交換し,取引費を過剰に発生させる
  3. パラメータを正しく設定しない場合,信号が多すぎたり少なかったりします.
  4. CMOのパラメータは,品種特性に合わせて調整する必要があります.

逆転条件を適正に緩和し,保有期間を延長し,パラメータの組み合わせを最適化することでリスクを軽減することができる.

戦略の最適化

  1. 異なるストキャスティックパラメータによる効果の影響をテストできます.
  2. MACD,KDJなどの他の指標と組み合わせて代替または追加確認が可能
  3. 異なるCMOとWMAの長さのパラメータの最適化をテストできます.
  4. 特定のレベルでのストップ・ストップを追加してみましょう.
  5. フィルタリング条件を設定して,開庫の頻度を制御できます.

要約する

この戦略は全体的に堅牢で,パラメータはシンプルで,実行しやすい.同時に,価格反転と動量指標を組み合わせて,効果的な二重信号フィルタリング機構を形成し,偽信号をフィルタリングすることができ,K線染色効果は直観的である.パラメータ最適化とリスク制御により,戦略のパフォーマンスをさらに向上させることができる.

ストラテジーソースコード
/*backtest
start: 2023-12-04 00:00:00
end: 2024-01-03 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 19/08/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 Chandre Momentum Oscillator and its WMA on the 
//    same chart. This indicator plots the absolute value of CMO.
//    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

CMOWMA(Length, LengthWMA) =>
    pos = 0
    xMom = abs(close - close[1])
    xSMA_mom = sma(xMom, Length)
    xMomLength = close - close[Length]
    nRes = 100 * (xMomLength / (xSMA_mom * Length))
    xWMACMO = wma(nRes, LengthWMA)
    pos := iff(nRes > xWMACMO, 1,
    	   iff(nRes <= xWMACMO, -1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal & CMO & WMA", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
LengthCMO = input(14, minval=1)
LengthWMA = input(13, minval=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posCMOWMA = CMOWMA(LengthCMO, LengthWMA)
pos = iff(posReversal123 == 1 and posCMOWMA == 1 , 1,
	   iff(posReversal123 == -1 and posCMOWMA == -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 )