3段階のトレンドブレイクアウトとモメンタムフォロー戦略

HLOC BAR TRINITY PA TA RANGE Trend
作成日: 2025-02-17 10:53:49 最終変更日: 2025-02-17 10:53:49
コピー: 0 クリック数: 371
1
フォロー
1617
フォロワー

3段階のトレンドブレイクアウトとモメンタムフォロー戦略 Based on the provided code, I’ll help create an SEO-friendly article analyzing this trading strategy in both Chinese and English.

概要

この戦略は,価格行動分析 (Price Action) とビル・ウィリアムズのK線三等分理論に基づいて,現在のK線と以前のK線の開値,閉値のK線三等分区間の位置関係を分析することによって,市場動向の転換点と継続性を識別し,取引信号を生成する.この戦略は,価格行動に完全に基づき,いかなる技術指標にも依存せず,取引過程における感情の偏差を体系的な方法によって排除する.

戦略原則

戦略の核心的な論理は,各K線の波動区間を3等分して,開盤価格と閉盤価格のこれらの区間の位置を分析することによって市場の傾向を判断することである.具体的には,以下を含む.

  1. Kラインの分類 - オープン・クローズド価格の位置に応じて,Kラインを複数のタイプに分類する.
    • 複数形:1-3 (下開き上収) 2-3 (中開き上収) 3-3 (上開き上収)
    • 空見形: 3-1 (上開き下収),2-1 (中開き下収),1-1 (下開き下収)
  2. 信号生成 - 連続した2つのK線の形状組み合わせによって取引信号を確認する:
    • 買取信号:前方のK線は任意の多形,現在のK線は1-3または3-3形
    • 売出信号:前K線は任意空見形,現在のK線は1-1または3-1形
  3. 取引の実行 - 確認信号の後に自動的に市場価格の命令を実行する:
    • 買入シグナルが出ると,空いたポジションを平らにして,余分に稼ぐ.
    • 売り込みの合図が出たとき,多額のポジションを平らにして空けます.

戦略的優位性

  1. 純価格駆動 - 価格行動分析のみに基づいて,技術指標の遅れを回避する
  2. 体系化された取引 - 明確なルール体系によって取引を実行し,主観的な判断による偏差を軽減する
  3. トレンドトラッキング - 価格の大幅な変動を効率的に捉え,単一の利益の余地を増やす
  4. リスク制御 - 連続した2つのK線を分析することによって信号信頼性を向上させる
  5. シンプルで直感的な - 戦略の論理が明確で,理解し実行しやすい

戦略リスク

  1. 振動市は適用されません - 区間振動の状況で頻繁に偽信号が生じる可能性があります.
  2. 入場時間が遅れている - 信号が確認されるまでK線が閉まるまで待たなければならず,最適な入場点を逃す可能性がある.
  3. 資金管理の欠如 - 戦略自体には止損防止機能がなく,追加のリスク管理が必要である
  4. 市場環境への依存 - 流動性の不足や高変動の環境で不良な結果が出る可能性
  5. パラメータの感受性 - Kライン周期の選択は,戦略のパフォーマンスに重要な影響を与える

戦略最適化の方向性

  1. 波動率フィルターの導入 - ATRなどの波動率指標を追加することで,異なる市場環境で取引頻度を動的に調整する
  2. リスク管理の改善 - K線3等分に基づくダイナミックな止損停止機構の設計
  3. 信号確認の最適化 - 信号の信頼性を高めるために,交差量,波動率などの補助指標の導入を考慮する
  4. 市場環境分析の追加 - 異なる市場環境で異なる取引パラメータを使用する市場状態認識モジュールを開発
  5. ポジション管理の改善 - シグナル強さや市場環境の動向に応じてポジション保有率の調整

要約する

この戦略は,K線三等分の革新的な方法によって価格行動を分析することで,シンプルで効果的なトレンド追跡システムを構築している.一定の限界があるものの,合理的な最適化とリスク管理措置によって,トレンドが顕著な市場環境下で安定した収益を得ることができる.戦略の核心的な優位性は,体系化された方法論と価格行動を深く分析することで,量化取引に参考にすべき研究方向を提供している.

ストラテジーソースコード
/*backtest
start: 2025-01-17 00:00:00
end: 2025-02-15 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("TrinityBar", overlay=true, initial_capital=100000, 
     default_qty_type=strategy.percent_of_equity, default_qty_value=200)

//─────────────────────────────────────────────────────────────
// Current Bar Thirds Calculations
//─────────────────────────────────────────────────────────────
cur_range      = high - low
cur_lowerThird = low + cur_range / 3
cur_upperThird = high - cur_range / 3

//─────────────────────────────────────────────────────────────
// Previous Bar Thirds Calculations
//─────────────────────────────────────────────────────────────
prev_range      = high[1] - low[1]
prev_lowerThird = low[1] + prev_range / 3
prev_upperThird = high[1] - prev_range / 3

//─────────────────────────────────────────────────────────────
// Define Bullish Bar Types for Current Bar
//─────────────────────────────────────────────────────────────
is_1_3 = (open <= cur_lowerThird) and (close >= cur_upperThird)
is_3_3 = (open >= cur_upperThird) and (close >= cur_upperThird)
is_2_3 = (open > cur_lowerThird) and (open < cur_upperThird) and (close >= cur_upperThird)

//─────────────────────────────────────────────────────────────
// Define Bearish Bar Types for Current Bar
//─────────────────────────────────────────────────────────────
is_3_1 = (open >= cur_upperThird) and (close <= cur_lowerThird)
is_1_1 = (open <= cur_lowerThird) and (close <= cur_lowerThird)
is_2_1 = (open > cur_lowerThird) and (open < cur_upperThird) and (close <= cur_lowerThird)

//─────────────────────────────────────────────────────────────
// Define Bullish Bar Types for Previous Bar
//─────────────────────────────────────────────────────────────
prev_is_1_3 = (open[1] <= prev_lowerThird) and (close[1] >= prev_upperThird)
prev_is_3_3 = (open[1] >= prev_upperThird) and (close[1] >= prev_upperThird)
prev_is_2_3 = (open[1] > prev_lowerThird) and (open[1] < prev_upperThird) and (close[1] >= prev_upperThird)

//─────────────────────────────────────────────────────────────
// Define Bearish Bar Types for Previous Bar
//─────────────────────────────────────────────────────────────
prev_is_3_1 = (open[1] >= prev_upperThird) and (close[1] <= prev_lowerThird)
prev_is_1_1 = (open[1] <= prev_lowerThird) and (close[1] <= prev_lowerThird)
prev_is_2_1 = (open[1] > prev_lowerThird) and (open[1] < prev_upperThird) and (close[1] <= prev_lowerThird)

//─────────────────────────────────────────────────────────────
// Valid Signal Conditions
//─────────────────────────────────────────────────────────────
// Bullish Signal: If the previous bar is any bullish type (2‑3, 3‑3, or 1‑3)
// and the current bar is either a 1‑3 or a 3‑3 bar.
validBuy = (prev_is_2_3 or prev_is_3_3 or prev_is_1_3) and (is_1_3 or is_3_3)

// Bearish Signal: If the previous bar is any bearish type (2‑1, 1‑1, or 3‑1)
// and the current bar is either a 1‑1 or a 3‑1 bar.
validSell = (prev_is_2_1 or prev_is_1_1 or prev_is_3_1) and (is_1_1 or is_3_1)

//─────────────────────────────────────────────────────────────
// Plot Only the Signal Triangles
//─────────────────────────────────────────────────────────────
plotshape(validBuy, title="Valid Buy", style=shape.triangleup, location=location.belowbar, 
     color=color.green, size=size.small, text="B")
plotshape(validSell, title="Valid Sell", style=shape.triangledown, location=location.abovebar, 
     color=color.red, size=size.small, text="S")

//─────────────────────────────────────────────────────────────
// Market Order Execution Based on Signals
//─────────────────────────────────────────────────────────────
if validBuy
    // Close any short positions.
    strategy.close("Short", comment="")
    // If not already long, enter a market long.
    if strategy.position_size <= 0
        strategy.entry("Long", strategy.long, comment="")
        
if validSell
    // Close any long positions.
    strategy.close("Long", comment="")
    // If not already short, enter a market short.
    if strategy.position_size >= 0
        strategy.entry("Short", strategy.short, comment="")