複数時系列トレンド識別型適応動的位置調整戦略

DEMA ATR supertrend
作成日: 2025-02-24 09:48:55 最終変更日: 2025-02-27 16:49:07
コピー: 5 クリック数: 433
2
フォロー
319
フォロワー

複数時系列トレンド識別型適応動的位置調整戦略 複数時系列トレンド識別型適応動的位置調整戦略

概要

この戦略は,Supertrendと二重指数移動平均 ((DEMA) に基づくトレンド追跡取引システムである.この戦略は,Supertrend指標のトレンド方向識別能力とDEMAのトレンド確認機能を組み合わせることで,信頼性の高い取引意思決定の枠組みを構築している.このシステムは,二方向取引をサポートし,ポジションのダイナミック調整機構を備えており,市場環境に応じて多空方向に柔軟に切り替えることができる.

戦略原則

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

  1. スーパートレンド指標:ATR周期を10で設定し,因数値は3.0で,価格トレンドを捉えるための転換点.
  2. DEMA指標:100周期の二重指数移動平均を用いて,市場騒音をフィルターし,トレンドの確認の信頼性を用いる.
  3. 取引シグナル生成メカニズム:
    • 多頭シグナル: 価格が超トレンドを突破し,閉盤価格がDEMA上にあるときにトリガーされる
    • 空頭シグナル:価格が超トレンドを突破し,DEMAの下の閉盘価格でトリガーされる
  4. ポジション管理:システムは,直接開設,反手,平和なポジション操作を含む,柔軟なポジション調整をサポートする.

戦略的優位性

  1. 多重確認メカニズム:スーパートレンドとDEMAの2つの指標を組み合わせることで,取引信号の信頼性が著しく向上する.
  2. 柔軟なポジション管理:多空双方向取引をサポートし,市場の状況に応じてポジションの方向を動的に調整できます.
  3. リスク管理の完善:トレンドの転換点に迅速な反応の仕組みがあり,新しいトレンドの機会を把握し,早期に停止することができます.
  4. パラメータの調整性:ATR周期,スーパートレンド因子,DEMA周期などの重要なパラメータは,異なる市場の特徴に応じて最適化できます.

戦略リスク

  1. 横軸市場の不具合: 市場環境で明らかなトレンドがない場合,頻繁に偽の突破シグナルが生じる可能性があります.
  2. 遅滞リスク:DEMAをフィルターとして使用すると,入場時間が少し遅れて,部分的な収益スペースに影響を与える可能性があります.
  3. パラメータ感性:戦略効果はパラメータ設定に敏感であり,異なる市場環境では異なるパラメータの組み合わせが必要になる可能性がある.

戦略最適化の方向性

  1. 変動率の自律調整を導入する:
    • 市場変動の変動に合わせて調整するSupertrend因子値
    • 高波動期にはフィルター・バルブを上げ,低波動期には適切な緩和条件
  2. 市場環境認識モジュールを追加する
    • トレンド強度指標を追加し,横軸市場での取引頻度を下げる
    • 突破効果の確認に役立つ交付量指標の導入
  3. ストップロスのメカニズムを改善する:
    • ATR ベースのダイナミック・ストップ・ローズを実現
    • モバイル・ストップ機能が追加され,収益を保護する

要約する

この戦略は,SupertrendとDEMAの指標を巧みに組み合わせて,安定したトレンド追跡システムを構築している.その優点は,信号の信頼性が高く,リスク管理が完善である,しかし,依然として,特定の市場の特徴に応じて,トレーダーによるパラメータの最適化が必要である.提案された最適化の方向によって,戦略の適応性と安定性がさらに向上する見込みがある.

ストラテジーソースコード
/*backtest
start: 2025-02-16 00:00:00
end: 2025-02-23 00:00:00
period: 5m
basePeriod: 5m
exchanges: [{"eid":"Binance","currency":"SOL_USDT"}]
*/

//@version=6
strategy("Supertrend with DEMA Strategy (Reversal Enabled)", overlay=true)

// ===== Parameters for Supertrend =====
atrPeriod = input.int(10, "ATR Length", minval=1)
factor    = input.float(3.0, "Factor", minval=0.01, step=0.01)

// ===== Parameters for Allowing Trade Directions =====
allowLong  = input.bool(true,  "Allow LONG")
allowShort = input.bool(true,  "Allow SHORT")

// Supertrend Calculation
[supertrend, direction] = ta.supertrend(factor, atrPeriod)
// Set the value to na for the first bar to avoid false signals
supertrend := barstate.isfirst ? na : supertrend

// Plot Supertrend Lines
plot(direction < 0 ? supertrend : na, "Up Trend",   color=color.green, style=plot.style_linebr)
plot(direction < 0 ? na : supertrend, "Down Trend", color=color.red,   style=plot.style_linebr)

// ===== Parameters and Calculation for DEMA =====
demaLength = input.int(100, "DEMA Length", minval=1)
e1 = ta.ema(close, demaLength)
e2 = ta.ema(e1, demaLength)
dema = 2 * e1 - e2

// Plot DEMA
plot(dema, "DEMA", color=#43A047)

// ===== Signal Definitions =====
// Basic Supertrend Trend Change Signals
trendUp   = ta.crossover(close, supertrend)
trendDown = ta.crossunder(close, supertrend)

// Entry Signals considering DEMA
longSignal  = trendUp and (close > dema)
shortSignal = trendDown and (close < dema)

// ===== Entry/Exit Logic =====

// LONG Signal
if (longSignal)
    // If there is an open SHORT position – reverse it to LONG if allowed
    if (strategy.position_size < 0)
        if (allowLong)
            strategy.close("Short")
            strategy.entry("Long", strategy.long)
        else
            // If reversal to LONG is not allowed – just close SHORT
            strategy.close("Short")
    // If there is no position – open LONG if allowed
    else if (strategy.position_size == 0)
        if (allowLong)
            strategy.entry("Long", strategy.long)

// SHORT Signal
if (shortSignal)
    // If there is an open LONG position – reverse it to SHORT if allowed
    if (strategy.position_size > 0)
        if (allowShort)
            strategy.close("Long")
            strategy.entry("Short", strategy.short)
        else
            // If reversal to SHORT is not allowed – just close LONG
            strategy.close("Long")
    // If there is no position – open SHORT if allowed
    else if (strategy.position_size == 0)
        if (allowShort)
            strategy.entry("Short", strategy.short)

// ===== Additional Position Closure on Trend Change without Entry =====
// If Supertrend crosses (trend change) but DEMA conditions are not met,
// close the opposite position if open.
if (trendUp and not longSignal and strategy.position_size < 0)
    strategy.close("Short")

if (trendDown and not shortSignal and strategy.position_size > 0)
    strategy.close("Long")