多次元エントロピー・モメンタム・トレンド適応型トレーディングシステム

CETP-Plus Shannon Entropy RSI ATR ADX EMA momentum 3D Histogram Volatility Filter
作成日: 2025-08-11 09:46:42 最終変更日: 2025-08-20 16:26:32
コピー: 4 クリック数: 353
2
フォロー
319
フォロワー

多次元エントロピー・モメンタム・トレンド適応型トレーディングシステム 多次元エントロピー・モメンタム・トレンド適応型トレーディングシステム

概要

多次元動量トレンド自己適応取引システムは,理論に基づく量化取引戦略であり,その核心はCETP-Plus指標であり,この指標は,シャノンの測定図モデルにおける”順序性”を測定する.このシステムは,指数移動平均の近期加重原理 (EMA),相対的に強い指数 (RSI) の動量偏差 (RSI),平均リアル範囲 (ATR) の波動的縮小と平均方向指数 (ADX) のトレンド強さを単一の評価に統合する.このユニークな方法は,複数の指標の複合性を回避し,早期のトレンド検出の正確性と多空取引の均衡性を向上させる.CETP-Plusは,比率 (実物,上下線) を3次元図に変換し,値を直線で計算する (値が低いと値が低いと値が低いと値が低いと値が低いと値が低いと値が低いと値が低いと値が低いと値が低いと値が低いと値が低いと値が低いと値が低いと

戦略原則

この戦略の核心原則は,金融市場の図形パターンの分析にシャノンを適用することである.シャノンは,情報理論に由来し,ランダム変数の不確実性または”混乱度”を量化するために用いられる.この戦略では,次の方法でを計算し,適用する.

  1. 比計算戦略は,まず,3つの重要な率を計算します. 实体比率 (トレンドの強さを反映する),上影線比率 (潜在的反転を反映する) と下影線比率 (潜在的反転を反映する).
  2. 指数的に減少し重み付け: 衰減因子 ((0.8) を使って,歴史図のデータに重み付け,最近のデータに重み付け,EMAの働き方と同じである.
  3. 3次元直角図の箱分け:比を3次元直角図に配置し,次元は実体,上影線,下影線に対応する.
  4. の計算:Shannon公式を使用して直角図の値を計算し,低は強いパターンがあることを示す.
  5. 動量偏差統合価格の動きを捉え,のスコアを調整するRSIのような計算方法.
  6. トレンドの強度調整:ADXのような計算方法により,トレンドの方向と強さを検出し,さらにスコアを調整する.
  7. 波動性調整:ATRを使用して波動的縮小を行い,異なる波動環境で信号が一致することを保証する.

最終的なCETPスコアはこれらの要因の複合産物であり,正値は看板に傾き,負値は看板に傾きする.取引の論理は単純で直接的な:CETPスコアは設定された正の値を超えると多めに,負の値を下ると空にする.微小取引を避けるために,戦略は最小価格移動フィルターを加え,現在のフィルターに取引を誘発するのに十分な範囲があることを保証する.リスク管理は,パーセントのストップ,ATRの倍数,およびストップロスの追跡によって実現される.

戦略的優位性

  1. 統合信号CETP-Plus指標は,複数の従来の指標 (EMA,RSI,ATR,ADX) の優位性を融合させ,単一の明確な取引信号を提供し,指標の衝突と過度に適合するリスクを回避します.

  2. 適応力がある戦略は,市場の状況に応じて自動的に調整し,さまざまな波動的な環境とトレンドの強さに適応し,手動の介入を必要とせずに,複数の市場状態で良好なパフォーマンスを発揮します.

  3. 対称多空処理戦略は,多頭と空頭の機会に等しい重みを与え,牛市と熊市の両方で効率的に機能させ,方向性偏見の影響を受けません.

  4. 早期のトレンドの認識の概念により,市場構造の変化を捉え,従来の指標より前にトレンドの早期形成を認識し,より良い入場時間を提供します.

  5. 騒音の影響を軽減する分析と直方図のボックス化技術により,戦略は真の信号と市場のノイズを区別し,偽信号の発生を減らすことができます.

  6. カスタマイズ可能: 多くのパラメータは,異なる取引品種と時間枠で最適化され,戦略が高度な柔軟性と適応性を持つことができます.

  7. リスクの管理: パーセンテージ・ストップ,ATRベースのダイナミック・ストップとトラッキング・ストップ,最小取引フィルター,有効な撤回制御を含む,多層のリスク管理機構を統合した.

戦略リスク

  1. パラメータ感度: 策略には複数の調整可能なパラメータが含まれ,過度に最適化すると,実体取引において不良なパフォーマンスを引き起こす可能性がある.異なる市場環境は,異なるパラメータ設定を必要とし,システム維持を複雑にするかもしれない.

  2. 高周波取引のリスク戦略は,特に波動性の高い市場では,大量取引信号を発生させ,過剰取引,手数料のコストの増加,滑り点を拡大する可能性があります.

  3. 計算の複雑さ: 3D直角図の分割ボックスと計算は,リアルタイムで実行する際に高い計算リソースを必要とし,実行の遅延を引き起こす可能性があります,特により短い時間枠で.

  4. アルゴリズムによるリスク推定策略は,が市場パターンを効果的に捉えるという仮定に基づいているが,市場構造は時間とともに変化し,この仮定を無効にする可能性がある.

  5. 変動性依存戦略: 波動性フィルターと最小価格移動フィルターを使用し,低波動性環境では取引機会を逃す可能性があり,高波動性環境では過度に敏感である可能性があります.

  6. 歴史的適合リスク戦略は複数の指標の優位性を組み合わせているものの,過去のデータに過度に適合するリスクがあり,将来の市場状況の変化により,業績が低下する可能性があります.

解決方法には,定期的にパラメータを再最適化し,ステップテストを使用してパラメータの安定性を検証し,取引頻度を減らすためにより厳しいフィルタリング条件を実施し,信号品質を向上させるために確認条件を追加し,リアルタイムモニタリングシステムのパフォーマンスを調整するリスクパラメータが含まれます.

戦略最適化の方向性

  1. 適応パラメータ機構パラメータのダイナミックな調整を実現し,市場の変動,取引量,トレンドの強さに応じてCETPウィンドウ,値,およびウェイトを自動的に最適化します.この最適化は,システムが変化する市場条件により良く適応し,手動介入の必要性を減らすことができます.

  2. 多時間枠分析統合:異なる時間枠のCETP信号を統合し,階層確認システムを作成する.例えば,より高い時間枠の信号と取引時間枠の信号が一致するときにのみ取引を実行し,勝利率を向上させる.

  3. 機械学習の強化:機械学習アルゴリズムを導入し,パラメータ選択と信号フィルタリングを最適化します. 監視学習による最良のパフォーマンスを示すパラメータの組み合わせを識別するか,または,異なる市場状態を識別し,相応に戦略を調整するために,集束アルゴリズムを使用します.

  4. 流動性および取引量フィルター: 取引量と市場深さのフィルターを追加し,流動性の充足した条件でのみ取引を保証し,スライドポイントと実行リスクを軽減します.

  5. 多資産関連分析関連市場 (指数,関連株,商品など) の情報を統合し,複数の関連市場から一致した信号が出るときに取引の確信を高めます.

  6. 波動性予測モデル: 変動予測コンポーネントを開発し,臨界値とリスクパラメータを事前に調整し,来る波動的な環境のために準備する.

  7. 自動回帰と最適化フレームワーク: 自動化システムを構築し,新しいデータで定期的に戦略を再評価し,最新の市場行動に応じてパラメータを調整し,戦略が適応性を保ちます.

上記の最適化の方向は,戦略の安定性,適応性,収益性を向上させ,同時に人為的介入の必要性および過度適合のリスクを軽減することを目的としています.これらの最適化を段階的に実施することにより,よりスマートで自律的な取引システムを構築することができます.

要約する

多次元動量トレンド自己適応取引システムは,情報理論のの概念を金融市場に適用することで,金融市場における秩序性と予測性を捉える革新的な量化取引方法を表している.この戦略の核心的な優位性は,複数の伝統的な技術指標の数学原理を統合して,単一で明確な取引シグナルを作成し,指標の衝突とシグナル混同を避けることにある.CETP-Plus指標は,3次元直角グラフの箱とを計算し,動量偏差,トレンドの強さと波動性の調整を組み合わせて,早期のトレンド識別とバランスの取れた多空取引機会を提供します.

この戦略は,強力な自己適応性およびリスク管理機能を持つにもかかわらず,パラメータの感受性,計算の複雑性,市場構造の変化などの課題に直面しています.自己適応性パラメータ機構,多時間枠分析,機械学習強化などの推奨された最適化方向を実装することにより,戦略の安定性および長期的なパフォーマンスをさらに向上させることができます.

全体として,これは理論的な基礎がしっかりした,巧妙に設計された量化取引システムであり,プログラミングと統計学の背景を持つトレーダーが,波動性の高い市場での適用に適しています.慎重なパラメータの最適化と継続的なシステム監視により,この戦略は,様々な市場環境で安定したリスク調整リターンを生み出す可能性があります.

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

// @version=6
strategy("Canuck Trading Traders Strategy [Candle Entropy Edition]", overlay=true, default_qty_value = 10)
// Note: Set Properties "Order size" to "100% of equity" for equity-based sizing or fixed contracts (e.g., 100).

// === CETP-Plus Settings ===
cetp_window = input.int(5, "CETP Window", minval=1, maxval=20, group="CETP-Plus Settings")
cetp_bins = input.int(3, "CETP Bins per Dimension", minval=1, maxval=10, group="CETP-Plus Settings")
long_threshold = input.float(0.1, "Long Threshold", minval=0.01, maxval=5.0, step=0.01, group="CETP-Plus Settings")
short_threshold = input.float(-0.1, "Short Threshold", minval=-0.8, maxval=-0.01, step=0.01, group="CETP-Plus Settings")
cetp_k = input.float(0.8, "CETP Momentum Weight", minval=0.1, maxval=5.0, step=0.1, group="CETP-Plus Settings")
mom_scale = input.float(6.0, "Momentum Scale", minval=1.0, maxval=20.0, step=1.0, group="CETP-Plus Settings")
body_weight = input.float(1.0, "Body Ratio Weight", minval=0.0, maxval=2.0, step=0.1, group="CETP-Plus Settings")
upper_weight = input.float(0.8, "Upper Wick Ratio Weight", minval=0.0, maxval=2.0, step=0.1, group="CETP-Plus Settings")
lower_weight = input.float(1.0, "Lower Wick Ratio Weight", minval=0.0, maxval=2.0, step=0.1, group="CETP-Plus Settings")
decay_factor = 0.8  // Hardcoded decay for exponential weighting (recent candles weighted more)

// === Trade Settings ===
min_score_strength = input.float(0.03, "Min CETP Score Strength", minval=0.0, maxval=5, step=0.01, group="Trade Settings")
stop_loss_pct = input.float(0.5, "Stop Loss (%)", minval=0.1, maxval=5.0, step=0.1, group="Trade Settings")
atr_mult = input.float(3.0, "ATR Multiplier", minval=0.5, maxval=10.0, step=0.1, group="Trade Settings")
trail_mult = input.float(5.0, "Trailing ATR Mult", minval=0.5, maxval=10.0, step=0.1, group="Trade Settings")
trail_offset_pct = input.float(1.0, "Trail Start Offset (%)", minval=0.5, maxval=10.0, step=0.1, group="Trade Settings")
min_price_move_mult = input.float(2.0, "Min Price Move ATR Mult (to avoid tiny trades)", minval=0.5, maxval=10.0, step=0.1, group="Trade Settings")  // Filter tiny moves

// Indicators (ATR for stops/trails only)
atr = nz(ta.atr(14), 0.0)

// Volatility Filter (CV < 15% to avoid chop)
vol_threshold = ta.stdev(close, 20) / ta.sma(close, 20) * 100
trade_allowed = vol_threshold < 15.0

// Minimum Price Move Filter (candle range > ATR multiple, floored by min tick)
min_price_move = math.max(atr * min_price_move_mult, syminfo.mintick * 10)  // Avoid sub-penny moves; 10x tick for robustness
price_move_condition = (high - low) > min_price_move  // Fixed: Use high - low instead of ta.range()

// CETP-Plus Calculation (Blended EMA, RSI, ATR, ADX theses)
epsilon = 1e-5
body_ratio = (close - open) / (high - low + epsilon) * body_weight
upper_wick_ratio = (high - math.max(open, close)) / (high - low + epsilon) * upper_weight
lower_wick_ratio = (math.min(open, close) - low) / (high - low + epsilon) * lower_weight

// EMA-like weighting: Exponentially weight recent candles with fixed-size rolling arrays
var float[] body_arr = array.new_float(cetp_window, 0.0)
var float[] upper_arr = array.new_float(cetp_window, 0.0)
var float[] lower_arr = array.new_float(cetp_window, 0.0)

// Shift and decay older values, add new at the end
for i = 0 to cetp_window - 2
    array.set(body_arr, i, array.get(body_arr, i + 1) * decay_factor)
    array.set(upper_arr, i, array.get(upper_arr, i + 1) * decay_factor)
    array.set(lower_arr, i, array.get(lower_arr, i + 1) * decay_factor)

array.set(body_arr, cetp_window - 1, body_ratio)
array.set(upper_arr, cetp_window - 1, upper_wick_ratio)
array.set(lower_arr, cetp_window - 1, lower_wick_ratio)

// Volatility scaling (ATR thesis)
bin_size = 2.0 / cetp_bins * (1 + atr / ta.sma(atr, 14))
hist_size = cetp_bins * cetp_bins * cetp_bins
var int[] hist = array.new_int(hist_size, 0)
array.fill(hist, 0)

for i = 0 to cetp_window - 1
    body_val = array.get(body_arr, i)
    upper_val = array.get(upper_arr, i)
    lower_val = array.get(lower_arr, i)
    
    body_bin = math.max(0, math.min(cetp_bins - 1, math.floor((body_val + 1) / bin_size)))
    upper_bin = math.max(0, math.min(cetp_bins - 1, math.floor((upper_val + 1) / bin_size)))
    lower_bin = math.max(0, math.min(cetp_bins - 1, math.floor((lower_val + 1) / bin_size)))
    
    bin_idx = body_bin * (cetp_bins * cetp_bins) + upper_bin * cetp_bins + lower_bin
    array.set(hist, bin_idx, array.get(hist, bin_idx) + 1)

entropy = 0.0
for i = 0 to hist_size - 1
    count = array.get(hist, i)
    p = count / cetp_window
    if p > 0
        entropy := entropy - p * math.log(p)

max_entropy = math.log(hist_size)
norm_entropy = max_entropy > 0 ? entropy / max_entropy : 0.0

// RSI-like momentum bias
avg_gain = ta.rma(math.max(close - close[1], 0), cetp_window)
avg_loss = ta.rma(math.max(close[1] - close, 0), cetp_window)
rsi_bias = avg_loss > 0 ? avg_gain / avg_loss : 1.0
momentum = ta.mom(close, cetp_window) / (close[cetp_window] != 0 ? close[cetp_window] : 1e-5)
momentum_adj = momentum * (1 + rsi_bias)

// ADX-like trend strength (automated and symmetric for bull/bear)
di_plus = ta.rma(math.max(high - high[1], 0), cetp_window) / atr
di_minus = ta.rma(math.max(low[1] - low, 0), cetp_window) / atr
trend_strength = di_plus > di_minus ? 1.2 : (di_minus > di_plus ? 1.2 : 1.0)

// CETP-Plus Score (optimized: no abs on momentum_adj to preserve sign for better short detection)
avg_body = nz(array.avg(body_arr), 0.0)
raw_score = avg_body * (1 - norm_entropy) * (cetp_k + momentum_adj * mom_scale)
cetp_score = nz(raw_score * trend_strength, 0.0)

// Position State
var float entry_price = na
var int bars_held = 0

if barstate.isconfirmed
    bars_held := strategy.position_size != 0 ? bars_held + 1 : 0

// Trade Logic: Rely solely on current CETP score for entries/exits/reversals, with min price move filter
if bar_index >= cetp_window and math.abs(cetp_score) > min_score_strength and trade_allowed and price_move_condition
    if cetp_score > long_threshold
        if strategy.position_size < 0
            strategy.close("Short", comment="Reverse to Long")
        if strategy.position_size <= 0
            strategy.entry("Long", strategy.long)
            entry_price := close
            sl = entry_price * (1 - stop_loss_pct / 100) - atr * atr_mult
            strategy.exit("Long Exit", "Long", stop=sl, trail_points=atr * trail_mult * syminfo.pointvalue, trail_offset=entry_price * (trail_offset_pct / 100))
            bars_held := 1
    else if cetp_score < short_threshold
        if strategy.position_size > 0
            strategy.close("Long", comment="Reverse to Short")
        if strategy.position_size >= 0
            strategy.entry("Short", strategy.short)
            entry_price := close
            sl = entry_price * (1 + stop_loss_pct / 100) + atr * atr_mult
            strategy.exit("Short Exit", "Short", stop=sl, trail_points=atr * trail_mult * syminfo.pointvalue, trail_offset=entry_price * (trail_offset_pct / 100))
            bars_held := 1