モメンタムマルチインジケータートレンド追跡戦略:ドンチャンチャネル+スーパートレンド+ボリュームフィルターポジション構築システム

DC ST MA VOL BO
作成日: 2025-02-21 11:47:17 最終変更日: 2025-02-21 11:47:17
コピー: 0 クリック数: 564
2
フォロー
319
フォロワー

モメンタムマルチインジケータートレンド追跡戦略:ドンチャンチャネル+スーパートレンド+ボリュームフィルターポジション構築システム モメンタムマルチインジケータートレンド追跡戦略:ドンチャンチャネル+スーパートレンド+ボリュームフィルターポジション構築システム

概要

この戦略は,ドンチアンチャネル (Donchian Channel) への突破に基づくトレンド追跡取引システムで,スーパートレンド指標 (SuperTrend) と取引量フィルター (trading volume filter) を組み合わせて取引信号の信頼性を強化している.この戦略は,価格の歴史的な突破高を捕捉することによって潜在的な多頭取引機会を主に識別し,取引量確認とトレンド追跡指標を偽の突破信号をフィルターするために使用する.戦略の設計は柔軟であり,異なる市場環境と取引品種に応じてパラメータ的に最適化することができます.

戦略原則

戦略の中核となるロジックは、次の主要な要素に基づいています。

  1. 唐通路:ユーザー定義周期内の最高値と最低値を計算し,上線,下線,中線を形成する.価格が上線を突破すると,多頭入場信号を触発する.
  2. 取引量フィルター:現在の取引量と20サイクル移動平均を比較して,取引量が増大する時にのみ出場することを保証し,突破の信頼性を高めます.
  3. 超トレンド指標:トレンド確認ツールとして,多頭トレンドでは緑色,空頭トレンドでは赤色で表示されます.
  4. 柔軟なストップメカニズム: 下線ストップ,中線ストップ,超トレンドストップ,パーセンテージ・トラッキングストップを含む4つの異なるストップオプションを提供します.

戦略的優位性

  1. 複数のシグナルの確認:価格の突破,取引量の確認,トレンド指標を組み合わせて,偽の突破のリスクを大幅に軽減します.
  2. 適応性:パラメータの調整により,異なる市場環境と取引サイクルに適応できます.
  3. リスク管理の改善:市場特性に応じて最も適したストップ方法を選択できる複数のストップオプションを提供
  4. ビジュアル化:戦略インターフェースは,市場状況を容易に理解するために,指標を直視的に表示します.
  5. リベーリングの柔軟性: リベーリングの時間帯をカスタマイズして,戦略を最適化できます.

戦略リスク

  1. 振動市場のリスク:区間振動の状況で頻繁に偽の突破信号が生じることがあります.
  2. スライドポイントリスク:流動性が低い市場では,ブレイクシグナルがスライドポイントによって入場価格の偏移を引き起こす可能性がある.
  3. 過剰フィルタリングの危険性: 取引量フィルタリングを有効にすると,有効な取引機会を逃す可能性があります.
  4. パラメータの感度: 戦略の効果はパラメータ設定に敏感であり、慎重な最適化が必要です。

戦略最適化の方向性

  1. トレンド強度フィルターを追加: ADXなどのトレンド強度指標を追加し,トレンドが強いときにのみ入場できます.
  2. 取引量指標の最適化:相対取引量または取引量突破指標を単純移動平均の代わりとして使用することを考えることができます.
  3. タイムフィルターを追加:取引時間ウィンドウの設定を追加し,市場の波動が大きい時間を回避します.
  4. ダイナミックパラメータ最適化:市場の波動率に応じて,経路周期と超トレンドパラメータを自動的に調整する.
  5. 機械学習の導入:機械学習アルゴリズムを使用してパラメータ選択と信号フィルタリングを最適化する.

要約する

この戦略は,複数の技術指標を総合的に使用することによって,比較的完ぺきなトレンド追跡取引システムを構築している.この戦略の優点は,信号の信頼性が高いこと,リスク管理の柔軟性にあるが,依然として,特定の市場の特徴に応じてトレーダーによるパラメータの最適化が必要である.この戦略は,継続的な改善と最適化によって,トレンド市場の安定した取引効果を得ることが期待されている.

ストラテジーソースコード
/*backtest
start: 2024-10-01 00:00:00
end: 2025-02-19 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/

// Breakout trading system based on Donchain channel strategy that works best on a weekly chart and daily charts. Weekly is preferred. 

//@version=5

strategy('Donchian BO with Volume Filter and Supertrend', shorttitle='DBO+Vol+ST', default_qty_type=strategy.percent_of_equity, default_qty_value=2, overlay=true)

// Input options to configure backtest date range
startDate = input.int(title='Start Date', defval=1, minval=1, maxval=31)
startMonth = input.int(title='Start Month', defval=1, minval=1, maxval=12)
startYear = input.int(title='Start Year', defval=2016, minval=1800, maxval=2100)
avgVol = input.int(title="Avg Volume length", defval=20)
srcInput = input.source(close, "Source")

// Volume filter toggle
useVolumeFilter = input.bool(true, title='Enable Volume Filter')

endDate = input.int(title='End Date', defval=1, minval=1, maxval=31)
endMonth = input.int(title='End Month', defval=7, minval=1, maxval=12)
endYear = input.int(title='End Year', defval=2030, minval=1800, maxval=2100)

multiplier = input.int(title='SuperTrend Mult', defval=2, minval=1, maxval=12)
stlen = input.int(title='SuperTrend Length', defval=10, minval=1, maxval=12)

length = input.int(21, minval=1)
exit = input.int(3, minval=1, maxval=4, title='Exit Option')  // Use Option 1 to exit using lower band; Use Option 2 to exit using basis line

lower = ta.lowest(length)
upper = ta.highest(length)
basis = math.avg(upper, lower)

// Plotting the Donchian channel
l = plot(lower, color=color.new(color.blue, 0))
u = plot(upper, color=color.new(color.blue, 0))
plot(basis, color=color.new(color.orange, 0))
fill(u, l, color=color.new(color.blue, 90))

// Check if the current bar is in the date range
inDateRange = time >= timestamp(syminfo.timezone, startYear, startMonth, startDate, 0, 0) and time < timestamp(syminfo.timezone, endYear, endMonth, endDate, 0, 0)

// Long trailing stop-loss percentage
longTrailPerc = input.float(title='Trail Long Loss (%)', minval=0.0, step=0.1, defval=3) * 0.01
longStopPrice = 0.0

longStopPrice := if strategy.position_size > 0
    stopValue = close * (1 - longTrailPerc)
    math.max(stopValue, longStopPrice[1])
else
    0

// Volume filter: 20-period moving average
volumeMA = ta.sma(volume, avgVol)

// Long entry condition: Donchian breakout + volume filter
longCondition = ta.crossover(srcInput, upper[1]) and (not useVolumeFilter or volume > volumeMA)
longsma = ta.sma(close, 200)

if inDateRange and longCondition
    strategy.entry('Long', strategy.long)

// Exit conditions
if inDateRange and exit == 1
    if ta.crossunder(close, lower[1])
        strategy.close('Long')

if inDateRange and exit == 2
    if ta.crossunder(close, basis[1])
        strategy.close('Long')

[superTrend, dir] = ta.supertrend(multiplier, stlen)
if inDateRange and exit == 3
    if ta.crossunder(close, superTrend)
        strategy.close('Long')

if inDateRange and exit == 4
    if strategy.position_size > 0
        strategy.exit(id='XL TRL STP', stop=longStopPrice)

// Short conditions (commented out for now)
shortCondition = ta.crossunder(close, lower[1])

// Exit all positions when date range ends
if not inDateRange
    strategy.close_all()

// --- Add Supertrend Indicator ---
stColor = dir == 1 ? color.red : color.green
plot(superTrend, color=stColor, title="SuperTrend", linewidth=2)