平均回帰に基づくマルチレベルのサポートとレジスタンスの週次取引戦略

Pivot SR MR SMA RSI ATR MA VOL
作成日: 2025-02-18 18:04:15 最終変更日: 2025-02-18 18:04:15
コピー: 2 クリック数: 441
1
フォロー
1617
フォロワー

平均回帰に基づくマルチレベルのサポートとレジスタンスの週次取引戦略

概要

この戦略は,周回線枢軸[[Pivot Point]]に基づく平均値回帰取引システムである.これは,毎週サポート[[S1-S4]]とレジスタンス[[R1-R4]]を計算して取引の入場と出場点を決定する.この戦略は,段階的にポジションを構築し,異なるサポートの位置で複数回購入し,対応するレジスタンス位置で利益を上げることを採用している.この方法は,市場の波動的特性を充分利用し,横軸の振動市場で優れている.

戦略原則

戦略の核心は,前週の最高価格,最低価格,閉店価格を計算して,今週の枢軸点を計算し,それから,既定の点数距離に基づいて複数のサポートとレジスタンス値を決定することです.価格がサポートに触れたときに購入し,対応するレジスタンスに利益の目標を設定します.具体的計算式は, 枢軸点 = (先週の最高価格 + 先週の最低価格 + 先週の閉店価格) / 3 戦略は,最大4つのポジションを同時に保持することを許可し,各ポジションは異なるサポートとレジスタンスに対応しています. すべてのポジションは,毎週の初めに新しい取引レベルを再計算します. この設計は,取引の連続性を保証するとともに,市場の変化に対応します.

戦略的優位性

  1. トランザクションロジックは明確で、理解しやすく、実行しやすい
  2. 段階的に倉庫を建設することで,1回の取引のリスクを低減する
  3. 周回線レベルでのサポート抵抗位を利用して,日中の騒音の影響を減らす
  4. 戦略は市場特性に合わせてパラメータを柔軟に調整できます.
  5. リスクの管理方法
  6. 取引に十分な利潤の余地を与えるために,時間がない.

戦略リスク

  1. ストップが設定されていない場合,強いトレンドの市場では大きな引き下がりが起こる可能性があります.
  2. 複数のポジションで,より多くの資金が使用される可能性があります.
  3. 波動の激しい市場では,偽の信号が出る可能性があります.
  4. 不適切な支柱の設定は,不合理な位置に倉庫を建設する可能性があります. リスクを軽減するために,トレンドフィルターを追加し,上昇傾向のみでポジションを開くことをお勧めします.同時に,ATRベースのダイナミックストップを設定できます.

戦略最適化の方向性

  1. 輸送量確認の仕組みを拡張し,入口信号の信頼性を向上させる
  2. RSIなどの技術指標を導入し,過買過売をフィルターします.
  3. マルチタイムサイクル確認メカニズムを開発し,偽信号を減らす
  4. ポジション管理システムの最適化,市場変動の動向に合わせて倉庫の建設数調整
  5. 関連性分析を加え,高度な関連性のある市場での同時ポジションを避ける

要約する

これは古典的技術分析理論に基づく平均値回帰策で,周回線を支えるレジスタンス位の突破回落によって取引機会を捕捉する.戦略の設計は簡潔で弾力的で,波動性の高い市場での適用に適している.合理的なパラメータ最適化とリスク管理により,この戦略は,異なる市場環境で安定したパフォーマンスを維持することができる.トレーダーは,実盤を使用する前に,パラメータ設定を十分にテストし,特定の市場特性に応じて適切な調整を行うことをお勧めする.

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

// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ViZiV

//@version=5
strategy("Weekly Pivot Strategy, Created by ViZiV", overlay=true, pyramiding=50, initial_capital=100000, default_qty_type=strategy.percent_of_equity, default_qty_value=25, dynamic_requests=true)

// This is my first COMPLETED strategy, go easy on me :) - Feel free to imrprove upon this script by adding more features if you feel up to the task. Im 100% confiedent there are better coders than me :) I'm still learning.

// This is a LONG ONLY SWING STRATEGY (Patience REQUIRED) that being said, you can go short at you're own discretion. I prefer to use on NQ / US100 / USTech 100 but not limited to it. Im sure it can work in most markets. "You'll need to change settings to suit you're market".

// IMPORTANT NOTE: "default_qty_type=strategy.percent_of_equity" Can be changed to "Contacts" within the properties tab which allow you to see backtest of other markets. Reccomend 1 contract but it comes to preference.

// Inputs for support/resistance distances (Defined by Points). // IMPORTANT NOTE: Completely user Defined. Figure out best settings for what you're trading. Each market is different with different characteristics. Up to you to figure out YOU'RE market volatility for better results. 
s1_offset = input.float(155, "S1 Distance", step=1)
s2_offset = input.float(310, "S2 Distance", step=1)
s3_offset = input.float(465, "S3 Distance", step=1)
s4_offset = input.float(775, "S4 Distance", step=1)
r1_offset = input.float(155, "R1 Distance", step=1)
r2_offset = input.float(310, "R2 Distance", step=1)
r3_offset = input.float(465, "R3 Distance", step=1)
r4_offset = input.float(775, "R4 Distance", step=1)

// Weekly pivot calculation
var float pivot = na
var float s1 = na
var float s2 = na
var float s3 = na
var float s4 = na
var float r1 = na
var float r2 = na
var float r3 = na
var float r4 = na

// Get weekly data (Pivot Calculation)
prevWeekHigh = request.security(syminfo.tickerid, "W", high[1], lookahead=barmerge.lookahead_on)
prevWeekLow = request.security(syminfo.tickerid, "W", low[1], lookahead=barmerge.lookahead_on)
prevWeekClose = request.security(syminfo.tickerid, "W", close[1], lookahead=barmerge.lookahead_on)

// Track active trades
var array<string> entry_ids = array.new<string>(0)
var array<float> profit_targets = array.new<float>(0)

// Update weekly levels
isNewWeek = ta.change(time("W")) != 0
if isNewWeek or na(pivot)
    pivot := (prevWeekHigh + prevWeekLow + prevWeekClose) / 3
    s1 := pivot - s1_offset
    s2 := pivot - s2_offset
    s3 := pivot - s3_offset
    s4 := pivot - s4_offset
    r1 := pivot + r1_offset
    r2 := pivot + r2_offset
    r3 := pivot + r3_offset
    r4 := pivot + r4_offset

// Plot current week's levels
plot(pivot, "Pivot", color=color.gray, linewidth=2)
plot(s1, "S1", color=color.blue, linewidth=1)
plot(s2, "S2", color=color.blue, linewidth=1)
plot(s3, "S3", color=color.blue, linewidth=1)
plot(s4, "S4", color=color.blue, linewidth=1)
plot(r1, "R1", color=color.red, linewidth=1)
plot(r2, "R2", color=color.red, linewidth=1)
plot(r3, "R3", color=color.red, linewidth=1)
plot(r4, "R4", color=color.red, linewidth=1)

// Function to create unique trade entries
checkEntry(level, target, entryNumber) =>
    currentWeek = str.tostring(year(time)) + "_" + str.tostring(weekofyear(time))
    entryId = "Entry" + str.tostring(entryNumber) + "_W" + currentWeek
    
    if low <= level and not array.includes(entry_ids, entryId)
        array.push(entry_ids, entryId)
        array.push(profit_targets, target)
        strategy.entry(entryId, strategy.long)
        strategy.exit("Exit" + entryId, entryId, limit=target)

// Check all entry levels
checkEntry(s1, r1, 1)
checkEntry(s2, r2, 2)
checkEntry(s3, r3, 3)
checkEntry(s4, r4, 4)

// Clean up completed trades using while loop
i = array.size(entry_ids) - 1
while i >= 0
    entryId = array.get(entry_ids, i)
    target = array.get(profit_targets, i)
    
    if high >= target
        array.remove(entry_ids, i)
        array.remove(profit_targets, i)
    i := i - 1