デュアルトラックシステムモメンタムトレーディング戦略


作成日: 2023-11-22 15:26:28 最終変更日: 2023-11-22 15:26:28
コピー: 0 クリック数: 623
1
フォロー
1617
フォロワー

デュアルトラックシステムモメンタムトレーディング戦略

[trans]

概要

この戦略は,MACDとStoch RSIの2種類の指標を組み合わせて,二線取引システムを構築し,トレンドを追跡し,超跌超買い判断を実現します.戦略は,日線と4時間線の両方で指標を構築し,複数の時間枠の判断を実現し,誤判の可能性を減らす.

戦略原則

戦略のポートフォリオは,MACDとStoch RSIの2つの異なるタイプの技術指標を使用し,配置します. MACDは差動指標であり,価格の変化の速度を判断します.

戦略は,まず日線と4時間線でそれぞれMACDとStoch RSIの指標を構築し,トレンドと超買超売の判断を行う.

具体的には,MACD指標を構成し,DIF線とDEA線を金叉死叉として判断する.Stoch RSI指標を構成し,K線とD線を金叉死叉として判断する.

このように,戦略は,双線指標と複数の時間枠の判断を総合的に使用し,価格の変化速度と相対的な強さの全面的な判断を行うことで,意思決定の正確性を向上させ,より良いリターンを獲得するのに役立ちます.

優位分析

この戦略には以下の利点があります.

  1. 双線指標を組み合わせて,全体的な判断を行い,意思決定の正確性を向上させる
  2. 複数のタイムフレームを用いることで 誤判の可能性を減らす
  3. トレンド追跡と超買超売判断を用いて,価格変動の速度と相対的な弱さを総合的に考慮する
  4. 指標のパラメータは,異なる品種と市場環境に対応して調整できます
  5. コード構造は明確で,理解しやすく,拡張しやすい.

リスク分析

この戦略にはいくつかのリスクがあります.

  1. 市場にはシステムリスクがあり,完全に回避できない
  2. 指数パラメータの不適切な設定は,取引の頻度や機会の逃れにつながる可能性があります.
  3. 双線指標が同時に誤信号を発する確率は存在するが,単線指標より低い
  4. 市場が急激に変化する際には対応できず,例えば大きな黒天事件などに

対策として

  1. パラメータを最適化し,取引条件を調整し,誤判を減らす
  2. 複数の指標を組み合わせて判断力を高める
  3. 損失を抑える戦略を高め,単発損失のリスクを抑えること

最適化の方向

この戦略は,以下の点で改善できます.

  1. 複数の指標を組み合わせ,多指標戦略を策定する
  2. 機械学習アルゴリズムを追加し,動態パラメータ最適化を実現する.
  3. 市場情勢を判断する他の要因は,感情指標やニュース面などです.
  4. ストップ・ロスト・ストップ・ストップ・ストラテジーを増やし,資金管理を最適化
  5. 取引の種類を拡大し,より良い取引機会を模索

要約する

この戦略は,双線指標と複数の時間枠判断の組み合わせを使用し,価格変化の速度と相対的な強さを全面的に判断し,市場動向を効果的に取得し,単一の指標の誤判の欠陥を改善することができます.また,パラメータ調整の柔軟性,理解しやすく拡張するなどの利点があります.その後,複数の指標の組み合わせ,動的パラメータ最適化,感情指標の導入などの方法で拡張および最適化され,戦略のパフォーマンスをさらに向上させることができます.

||

Overview

This strategy combines the MACD and Stoch RSI indicators to build a dual-rail trading system for trend tracking and oversold/overbought judgment. The strategy also builds indicators on the daily and 4-hour timeframes to make multi-timeframe judgments to reduce misjudgment probability.

Strategy Principle

The strategy combines the MACD and Stoch RSI indicators, which are different types of technical indicators, for configuration. MACD is a momentum indicator that judges price change velocity; Stoch RSI is an overbought/oversold indicator that judges relative price strength.

The strategy first constructs the MACD and Stoch RSI indicators on the daily and 4-hour timeframes respectively for trend and overbought/oversold judgments. When signals are triggered on both timeframes, corresponding buy/sell operations are performed.

Specifically, the MACD indicator is constructed with the DIF and DEA lines forming golden/dead crosses for judgment; the Stoch RSI indicator is constructed with the K and D lines forming golden/dead crosses for judgment. When both indicator pairs have golden crosses, buy signals are generated; when both have dead crosses, sell signals are generated.

Thus, by comprehensively applying the dual-indicator system and multi-timeframe judgments, the strategy judges price velocity and relative strength thoroughly, which helps improve decision accuracy and gain better returns.

Advantage Analysis

This strategy has the following advantages:

  1. Combining dual-indicator system for comprehensive judgment and higher decision accuracy
  2. Applying multi-timeframe to reduce misjudgment probability
  3. Adopting trend tracking and overbought/oversold judgment for consideration of both price velocity and relative strength
  4. Flexible indicator parameters adjustable for different products and market environments
  5. Clean code structure easy to understand and expand

Risk Analysis

There are also some risks with this strategy:

  1. There exist systemic market risks that cannot be fully avoided
  2. Inappropriate indicator parameter settings may lead to overtrading or missing opportunities
  3. Dual indicators may still give concurrent wrong signals, but less likely than single ones
  4. Unable to cope with drastic market changes like black swan events

Countermeasures:

  1. Optimize parameters and adjust trading conditions to reduce misjudgments
  2. Incorporate more indicators for combined judgments
  3. Add stop loss mechanisms to control single loss risk

Optimization Directions

This strategy can also be improved in the following aspects:

  1. Incorporate more indicators for multi-indicator strategies
  2. Add machine learning algorithms for dynamic parameter optimization
  3. Combine sentiment indicators, news etc. for more comprehensive market condition judgments
  4. Add stop loss, take profit strategies to optimize money management
  5. Expand to more trading products to discover better opportunities

Conclusion

By combined application of the dual-indicator system and multi-timeframe judgments, this strategy judges price velocity and relative strength thoroughly, which can effectively capture market trends and improve deficiencies of single indicators. It also has advantages like flexible parameter tuning, easy understanding and expansion. Further expansions by multi-indicator combination, dynamic parameter optimization, sentiment indicator incorporation etc. can help boost strategy performance. [trans]

ストラテジーソースコード
/*backtest
start: 2023-11-14 00:00:00
end: 2023-11-15 10:00:00
period: 3m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
strategy(title='[RS]Khizon (UWTI) Strategy V0', shorttitle='K', overlay=false, pyramiding=0, initial_capital=100000, currency=currency.USD)
//  ||  Inputs:
macd_src = input(title='MACD Source:',  defval=close)
macd_fast = input(title='MACD Fast Length:',  defval=12)
macd_slow = input(title='MACD Slow Length:',  defval=26)
macd_signal_smooth = input(title='MACD Signal Smoothing:',  defval=9)
srsi_src = input(title='SRSI Source:',  defval=close)
srsi_rsi_length = input(title='SRSI RSI Length:',  defval=14)
srsi_stoch_length = input(title='SRSI Stoch Length:',  defval=14)
srsi_smooth = input(title='SRSI Smoothing:',  defval=3)
srsi_signal_smooth = input(title='SRSI Signal Smoothing:',  defval=3)
//  ||  Strategy Inputs:
trade_size = input(title='Trade Size in USD:', type=float, defval=1)
buy_trade = input(title='Perform buy trading?', type=bool, defval=true)
sel_trade = input(title='Perform sell trading?', type=bool, defval=true)
//  ||  MACD(close, 12, 26, 9):     ||---------------------------------------------||
f_macd_trigger(_src, _fast, _slow, _signal_smooth)=>
    _macd = ema(_src, _fast) - ema(_src, _slow)
    _signal = sma(_macd, _signal_smooth)
    _return_trigger = _macd >= _signal ? true : false
//  ||  Stoch RSI(close, 14, 14, 3, 3)  ||-----------------------------------------||
f_srsi_trigger(_src, _rsi_length, _stoch_length, _smooth, _signal_smooth)=>
    _rsi = rsi(_src, _rsi_length)
    _stoch = sma(stoch(_rsi, _rsi, _rsi, _stoch_length), _smooth)
    _signal = sma(_stoch, _signal_smooth)
    _return_trigger = _stoch >= _signal ? true : false
//  ||-----------------------------------------------------------------------------||
//  ||-----------------------------------------------------------------------------||
//  ||  Check Directional Bias from daily timeframe:
daily_trigger = security('USOIL', 'D', f_macd_trigger(macd_src, macd_fast, macd_slow, macd_signal_smooth) and f_srsi_trigger(srsi_src, srsi_rsi_length, srsi_stoch_length, srsi_smooth, srsi_signal_smooth))
h4_trigger = security('USOIL', '240', f_macd_trigger(macd_src, macd_fast, macd_slow, macd_signal_smooth) and f_srsi_trigger(srsi_src, srsi_rsi_length, srsi_stoch_length, srsi_smooth, srsi_signal_smooth))

plot(title='D1T', series=daily_trigger?0:na, style=circles, color=blue, linewidth=4, transp=65)
plot(title='H4T', series=h4_trigger?0:na, style=circles, color=navy, linewidth=2, transp=0)

sel_open = sel_trade and not daily_trigger and not h4_trigger
buy_open = buy_trade and daily_trigger and h4_trigger
sel_close = not buy_trade and daily_trigger and h4_trigger
buy_close = not sel_trade and not daily_trigger and not h4_trigger
strategy.entry('sel', long=false, qty=trade_size, comment='sel', when=sel_open)
strategy.close('sel', when=sel_close)
strategy.entry('buy', long=true, qty=trade_size, comment='buy', when=buy_open)
strategy.close('buy', when=buy_close)