モメント・ダブル・ムービング・メアワー・クロスオーバー戦略

作者: リン・ハーンチャオチャン開催日:2023年10月20日 16時44分30秒
タグ:

img

概要

この戦略は,移動平均のクロスオーバーを使用して価格の動向方向を決定し,全体的なトレンドを判断するために黄金/死亡のクロスで補完し,トレンドフォローを実装します.

戦略の論理

この戦略は,EMAとSMAのクロスオーバーを使用して価格動力の方向性を決定する.EMAはより速く反応し,SMAはより安定して反応する.EMAがSMAを超えると,上向きの勢いが強く,ロングに行くと判断される.EMAがSMAを下回ると,下向きの勢いが強く,ショートに行くと判断される.

また,この戦略は,全体的なトレンド方向を決定するために,高速期SMAと遅期SMAのクロスオーバーも使用する.高速期SMAが遅いSMAを超えると,それは市場が長期上昇傾向にあることを示唆する黄金十字である.高速期SMAが遅いSMAを下回ると,それは市場が長期下落傾向にあることを示唆する死亡十字である.

戦略は,EMAがSMAを上回るときに長い機会を特定する.この時点で黄金十字である場合,それは短期的なモメンタムと長期的トレンドの両方がサポートしていることを意味します.これはよりよい長期タイムです.死亡クロスである場合,ロングは短期的なモメンタムとよりリスクの高い長期トレンドに対してのみサポートされます.

利点分析

  • 価格の動力と方向性を判断するためにMAクロスオーバーを使用する
  • 短期的な勢いと長期的傾向の両方を考慮します
  • 二重指標の確認は信頼性を向上させる
  • MA パラメータを調整して異なる期間に適応可能
  • 特定の取引信号を表示/隠すように設定できます

リスク分析

  • MAクロスオーバーは遅延があり,最高のエントリー/出口ポイントを逃す可能性があります
  • 固定期間のSMAは,価格の変化をリアルタイムで反映できない.
  • 長期/短期MAsの誤ったクロスオーバーが起こる可能性があります.
  • 長期保有は資本リスクを増やす可能性がある

リスクは,シグナル確認のための他の指標を組み合わせ,MA期間を最適化,またはストップロスを設定することによって軽減できます.

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

  • ボランス,ボリンジャー帯など他のフィルターを追加します.
  • ストップ損失戦略を追加
  • MA 期間を最適化する
  • 資本管理を最適化する
  • ダイナミック位置サイズを考慮

結論

一般的に,これは比較的安定した信頼性の高いトレンドフォロー戦略である.短期的な価格勢いと長期的トレンド方向の両方を考慮し,MAクロスオーバーを通じて取引信号を生成する.単一のMA戦略と比較して,確認のために二重指標を組み合わせることで信頼性が高い.しかし,トレンドフォロー戦略として,そのパラメータ最適化とリスク制御は非常に重要です.その可能性を真に実現するために繰り返しテストとチューニングが必要です.継続的な最適化と改善により,この戦略は長期的定量投資ポートフォリオの貴重な構成要素になることができます.


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

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Cryptoluc1d

//@version=4
strategy("Equal-Length EMA/SMA Crossover Strategy", initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=25, commission_type=strategy.commission.percent, commission_value=0.2, overlay=true)

// Create inputs

mom_length = input(title="Momentum Length (EMA=SMA)", defval=50)
bias_length_fast  = input(title="Golden Cross Length (Fast)", defval=50)
bias_length_slow  = input(title="Golden Cross Length (Slow)", defval=100)

// Define MAs

ema = ema(close, mom_length) // EMA/SMA crossover of the same period for detecting trend acceleration/deceleration
sma = sma(close, mom_length)
bias_fast = sma(close, bias_length_fast) // golden/death cross for overall trend bias
bias_slow = sma(close, bias_length_slow)

// Define signal conditions

buy_trend = crossover(ema, sma) and bias_fast >= bias_slow // buy when EMA cross above SMA. if this happens during a bullish golden cross, buying is in confluence with the overall trend (bias).
buy_risky = crossover(ema, sma) and bias_fast < bias_slow // buy when EMA cross above SMA. if this happens during a bearish death cross, buying is early, more risky, and not in confluence with the overall trend (bias).
buy_late = crossover(sma, bias_slow) and ema > sma // the SMA crossing the Slow_SMA gives further confirmation of bullish trend, but signal comes later.
sell = crossunder(ema, sma) // sell when EMA cross under SMA.

// Enable option to hide signals, then plot signals

show_signal = input(title="Show Signals", defval=true)

plotshape(show_signal ? buy_trend : na, title='Trend Buy', style=shape.triangleup, location=location.belowbar, color=color.green, text='TREND BUY')
plotshape(show_signal ? buy_risky : na, title='Risky Buy', style=shape.triangleup, location=location.belowbar, color=color.olive, text='RISKY BUY')
plotshape(show_signal ? buy_late : na, title='Late Buy', style=shape.triangleup, location=location.belowbar, color=color.lime, text='LATE BUY')
plotshape(show_signal ? sell : na, title='Sell', style=shape.triangledown, location=location.abovebar, color=color.red, text='SELL')

// Define entry and exit conditions

longCondition = ema > sma and bias_fast >= bias_slow // LONG when EMA above SMA, and overall trend bias is bullish
if (longCondition)
    strategy.entry("BUY TREND", strategy.long)
exitLong = crossunder(ema, sma) // close LONG when EMA cross under SMA
strategy.close("BUY TREND", when=exitLong)

// // short conditions. turned off because up only.
// shortCondition = ema < sma and bias_fast <= bias_slow // SHORT when EMA under SMA, and overall trend bias is bearish
// if (shortCondition)
//     strategy.entry("SELL TREND", strategy.short)
// exitShort = crossover(ema, sma) // close SHORT when EMA cross over SMA
// strategy.close("SELL TREND", when=exitShort)

// Enable option to show MAs, then plot MAs

show_ma = input(title="Show MAs", defval=false)

plot(show_ma ? ema : na, title="Momentum EMA", color=color.green, linewidth=1)
plot(show_ma ? sma : na, title="Momentum SMA", color=color.yellow, linewidth=1)
plot(show_ma ? bias_fast : na, title="Golden Cross SMA (Fast)", color=color.orange, linewidth=2)
plot(show_ma ? bias_slow : na, title="Golden Cross SMA (Slow)", color=color.red, linewidth=2)

もっと