双方向逆転とモメンタム移動平均戦略

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

img

概要

この戦略は逆転取引ルールをモメントインジケーターと組み合わせ,双方向逆転とチャンデモメントオシレーターを統合し,より信頼性の高い取引信号を生成するためにモメント信号を検証しながら逆転機会を特定します.

戦略の論理

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

第1部は二方向逆転取引ルールである.前2日の閉じる価格の変化を検出することによって逆転機会を特定する.特に,前2日の閉じる価格が減少し,現在の閉じる価格が前回の閉じる価格よりも高く,ストコスタスティックオシレーターが値を下回っている場合,購入信号を誘発する.逆に,前2日の閉じる価格が上昇し,現在の閉じる価格が前回の閉じる価格よりも低く,ストコスタスティックオシレーターが値を下回っている場合,販売信号を誘発する.

2つ目の部分はチャンド・モメントオシレーターである.モメントを決定するために,価格変化の大きさを一定の期間の平均幅と比較する.モメントインジケーターが上限を超えると,購入信号を生成する.下限を下回ると,販売信号を生成する.

この戦略は,潜在的な逆転点を特定するための二方向逆転取引規則と,逆転信号の有効性を検証するためのモメントインジケーターを組み合わせます.両方の信号が一致するときにのみ,実際の購入または販売信号が生成されます.

戦略 の 利点

  • 双重検証メカニズムは,偽信号を回避することによって信号の信頼性を向上させる.逆転取引規則は,潜在的な逆転点を特定し,モメント指標は,逆転信号の有効性を検証する.

  • 逆転戦略とトレンド戦略を組み合わせることで,逆転市場とトレンド市場の両方の機会を把握する柔軟性があります.

  • モメントが確認されたときに取引するだけで,逆転の罠にはまりないようにします.

  • 複数の調整可能なパラメータを異なる市場条件に最適化できます.

戦略 の リスク

  • 逆転シグナルは大きな引き下げに直面し,合理的なストップ損失を必要とする可能性があります.

  • 逆転の正確なタイミングは 難しいし 判断を誤る可能性があります

  • モメントインジケーターの遅延により 最適の逆転エントリーポイントが欠落する可能性があります

  • パラメータ調整は,特定の市場に基づいて慎重に最適化する必要があります. 不適切な設定はリスクを増やす可能性があります.

適切なストップ損失,強力なパラメータ最適化,逆転信号誘発条件に一定の空間を保つなどによってリスクを軽減することができます.

最適化 に 関する 指示

  • 市場逆転に敏感なパラメータを見つけるために,異なる逆転パラメータの組み合わせをテストする.

  • RSIやボリューム変化率などです

  • キーでない逆転点を避けるために フィルターを追加します

  • ストップ・ロスの戦略を評価し,最大引き下げ制御方法を見つけます.

  • ポジションサイズを市場状況に基づいて調整するためのポジションサイズ戦略を評価する.

結論

この戦略は,逆転戦略とモメント戦略の利点と,信頼性の高い信号と機会を把握するための柔軟性を組み合わせている.パラメータは最適化され,ストップ損失とポジションサイジングを通じてリスクを管理し,安定性と収益性を向上させることができる.全体として,逆転戦略とトレンド戦略の効果的な統合を探求し,さらなる研究と適用に値する.


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

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 18/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 Chande Momentum Oscillator. 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

CMO(Length, TopBand, LowBand) =>
    pos = 0
    xMom = abs(close - close[1])
    xSMA_mom = sma(xMom, Length)
    xMomLength = close - close[Length]
    nRes = 100 * (xMomLength / (xSMA_mom * Length))
    pos :=  iff(nRes > TopBand, 1,
	         iff(nRes <= LowBand, -1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal & Chande Momentum Oscillator", 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(9, minval=1)
TopBand = input(70, minval=1)
LowBand = input(-70, maxval=-1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posCMO = CMO(LengthCMO, TopBand, LowBand)
pos = iff(posReversal123 == 1 and posCMO == 1 , 1,
	   iff(posReversal123 == -1 and posCMO == -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 )

もっと