指数移動平均と適応型ボラティリティ閾値を用いた動的トレンド識別戦略

EMA ADX ATR P&L ROI
作成日: 2025-04-03 13:08:04 最終変更日: 2025-04-03 13:08:04
コピー: 0 クリック数: 342
2
フォロー
319
フォロワー

指数移動平均と適応型ボラティリティ閾値を用いた動的トレンド識別戦略 指数移動平均と適応型ボラティリティ閾値を用いた動的トレンド識別戦略

概要

OneTrend Lite EMA戦略は,指数移動平均 ((EMA),平均トレンド指数 ((ADX) と平均実際の波動範囲 ((ATR) を組み合わせて市場動向を識別し,捕捉する革新的なトレンド追跡取引方法である.この戦略は,明確な,規則的な取引信号を提供し,市場波動に対する感受性を動的に調整することを目的としている.

戦略原則

戦略の核心は,以下の3つの重要な技術指標を中心に展開されています.

  1. 急速および遅いEMA:異なる周期長さの指数移動平均を計算して価格変化の傾向を捉える
  2. カスタムADX計算:トレンドの強さと市場の動力を評価する
  3. 動的ATR値:ADX値による自己適応トレンド判断に対する感度

戦略は30サイクル高速EMAと60サイクル遅いEMAを使用して,それらの差値と自己適応ATRの倍数を組み合わせて取引信号を生成する.高速EMAがダイナミックな値を超えると青いトレンドゾーン ((() に入り,値を下回るとピンクゾーン (((下落) に入りする.

戦略的優位性

  1. 適応性:ダイナミックなADX値下げにより,戦略は異なる市場条件に合わせて敏感度を調整できます.
  2. 多次元指標組合せ:EMA,ADX,ATRを統合し,信号の正確性を向上させる
  3. 明確なビジュアル取引区間:青とピンクの区間は,トレンドの変化を直視的に示しています.
  4. リスク管理の柔軟性: EMA周期,ATR倍数,ADXの値を調整できる

戦略リスク

  1. 遅滞性:EMAは本質的に遅滞性があり,急速に変化する市場で反応を遅らせる可能性があります.
  2. 波動的な市場表現: 明確なトレンドがない市場では,頻繁で無効な取引シグナルが生じる可能性があります.
  3. パラメータ感性:戦略の性能は選択されたパラメータに高度に依存し,継続的な反測と最適化が必要です.

戦略最適化の方向性

  1. 機械学習アルゴリズムの導入:AI技術を用いて動的に最適化するパラメータの選択
  2. 多時間枠検証:異なる時間尺度で戦略の安定性を検証する
  3. 他の指標を組み合わせる:RSI,MACDなどの動量指標を組み合わせて信号の正確性を高める
  4. 適応性ストップメカニズム:ATRの動向に応じてストップ戦略を調整する

要約する

OneTrend Lite EMA戦略は,革新的な指標の組み合わせと自己適応の値によって,トレーダーに柔軟で直感的なトレンド追跡方法を提供します.いくつかの固有のリスクがあるにもかかわらず,その多次元分析とダイナミックな調整能力は,深入の研究に値する量化取引戦略にします.

ストラテジーソースコード
/*backtest
start: 2024-04-03 00:00:00
end: 2025-04-02 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BNB_USDT"}]
*/

//============================== OneTrend Lite Historical Performance ==============================/
//+--------+-----------+-----------+-----------+--------------------+---------------+---------------+
//| Ticker | Total P&L | Drawdown  | # Trades  | Profitable Trades  | Profit Factor | Best Method   |
//+--------+-----------+-----------+-----------+--------------------+---------------+---------------+
//| BTC    | 557x      | 55.29%    | 11        | 72.73%             | 13.579        | OneTrend Pro  |
//| ETH    | 207x      | 55.11%    | 13        | 46.15%             | 1.696         | OneTrend Pro  |
//| XRP    | 29x       | 99.85%    | 23        | 30.43%             | 1.261         | OneTrend Gaus |
//| SOL    | 152x      | 40.20%    | 8         | 62.50%             | 4.341         | OneTrend Gaus |
//| BNB    | 519x      | 64.29%    | 12        | 50.00%             | 3.351         | OneTrend Lite |
//| DOGE   | 21x       | 89.63%    | 22        | 27.27%             | 1.521         | OneTrend Gaus |
//| ADA    | 9x        | 76.18%    | 9         | 55.56%             | 9.039         | OneTrend Pro  |
//| SUI    | 6.6x      | 11.44%    | 2         | 100.00%            | ∞             | OneTrend Pro  |
//+--------+-----------+-----------+-----------+--------------------+---------------+---------------+

//============================== OneTrend Pro Historical Performance ===============================/
//+--------+-----------+-----------+-----------+--------------------+---------------+---------------+
//| Ticker | Total P&L | Drawdown  | # Trades  | Profitable Trades  | Profit Factor | Best Method   |
//+--------+-----------+-----------+-----------+--------------------+---------------+---------------+
//| BTC    | 723x      | 50.99%    | 41        | 53.66%             | 2.625         | OneTrend Pro  |
//| ETH    | 1925x     | 40.07%    | 31        | 58.06%             | 3.472         | OneTrend Pro  |
//| XRP    | 298x      | 99.97%    | 53        | 37.74%             | 1.87          | OneTrend Gaus |
//| SOL    | 917x      | 73.31%    | 18        | 44.44%             | 2.71          | OneTrend Gaus |
//| BNB    | 353x      | 49.44%    | 31        | 45.16%             | 2.849         | OneTrend Lite |
//| DOGE   | 238x      | 92.38%    | 40        | 40.00%             | 2.389         | OneTrend Gaus |
//| ADA    | 39x       | 71.96%    | 31        | 35.48%             | 1.684         | OneTrend Pro  |
//| SUI    | 8.7x      | 31.53%    | 4         | 50.00%             | 13.457        | OneTrend Pro  |
//+--------+-----------+-----------+-----------+--------------------+---------------+---------------+

//=========================== OneTrend Gaussian Historical Performance =============================/
//+--------+-----------+-----------+-----------+--------------------+---------------+---------------+
//| Ticker | Total P&L | Drawdown  | # Trades  | Profitable Trades  | Profit Factor | Best Method   |
//+--------+-----------+-----------+-----------+--------------------+---------------+---------------+
//| BTC    | 107x      | 72.45%    | 26        | 57.69%             | 5.5           | OneTrend Pro  |
//| ETH    | 10x       | 40.07%    | 31        | 58.06%             | 3.472         | OneTrend Pro  |
//| XRP    | 1125x     | 99.94%    | 29        | 48.28%             | 1.509         | OneTrend Gaus |
//| SOL    | 925x      | 52.10%    | 11        | 63.64%             | 11.338        | OneTrend Gaus |
//| BNB    | 434x      | 58.10%    | 22        | 59.09%             | 4.845         | OneTrend Lite |
//| DOGE   | 487x      | 90.48%    | 40        | 32.50%             | 2.263         | OneTrend Gaus |
//| ADA    | 20x       | 71.96%    | 31        | 35.48%             | 1.684         | OneTrend Pro  |
//| SUI    | 3.3x      | 31.53%    | 4         | 50.00%             | 13.457        | OneTrend Pro  |
//+--------+-----------+-----------+-----------+--------------------+---------------+---------------+

//@version=6
strategy("OneTrend Lite EMA", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100, initial_capital = 10000)

// ——— USER INPUTS ———
// EMA settings
emaFastLen = 30
emaSlowLen = 60
atrLen     = 60

// ADX settings
adxLen       = 14
adxThreshold = 20

// ATR multipliers for trend conditions
atrMultStrong = 0.3
atrMultWeak   = 0.1

// ——— CALCULATIONS ———
// Calculate EMAs and their difference
emaFast = ta.ema(close, emaFastLen)
emaSlow = ta.ema(close, emaSlowLen)
emaDiff = emaFast - emaSlow

// --- Custom ADX Calculation ---
up      = ta.change(high)
down    = -ta.change(low)
plusDM  = (up > down and up > 0) ? up : 0.0
minusDM = (down > up and down > 0) ? down : 0.0
trur    = ta.rma(ta.tr, adxLen)
plusDI  = 100 * ta.rma(plusDM, adxLen) / trur
minusDI = 100 * ta.rma(minusDM, adxLen) / trur
dx      = 100 * math.abs(plusDI - minusDI) / (plusDI + minusDI)
adxVal  = ta.rma(dx, adxLen)

// Determine the dynamic ATR multiplier based solely on ADX
dynamicAtrMult = adxVal > adxThreshold ? atrMultStrong : atrMultWeak

// Define bull (blue) and bear (pink) zones using the dynamic multiplier
emaBull = emaDiff > dynamicAtrMult * ta.atr(atrLen)
emaBear = emaDiff < -dynamicAtrMult * ta.atr(atrLen)

// ——— PLOTTING ———
clrBull    = color.rgb(70, 163, 255)   // Blue for bull
clrBear    = color.rgb(255, 102, 170)   // Pink for bear
clrNeutral = color.rgb(128, 128, 128)   // Gray for neutral

fastPlot = plot(emaFast, linewidth=2, color=emaBull ? clrBull : emaBear ? clrBear : clrNeutral, title="Fast EMA")
slowPlot = plot(emaSlow, linewidth=2, color=emaBull ? clrBull : emaBear ? clrBear : clrNeutral, title="Slow EMA")
fill(fastPlot, slowPlot, color=emaBull ? color.new(clrBull, 70) : emaBear ? color.new(clrBear, 70) : color.new(clrNeutral, 70))

// ——— STRATEGY LOGIC ———
// Enter long immediately when the zone turns blue, and exit when it turns pink.
if emaBull
    strategy.entry("Long", strategy.long, comment="Long Entry")
if emaBear
    strategy.close("Long", comment="Close Long")