大きなボラティリティのブレイクアウト双方向取引戦略:ポイントしきい値に基づくロングおよびショートエントリーシステム

ATR SL TP
作成日: 2024-11-18 16:11:21 最終変更日: 2024-11-18 16:11:21
コピー: 0 クリック数: 576
1
フォロー
1617
フォロワー

大きなボラティリティのブレイクアウト双方向取引戦略:ポイントしきい値に基づくロングおよびショートエントリーシステム

概要

この戦略は,価格の変動幅を監視して取引機会を探す30分間のK線に基づく二方向取引システムである.戦略の核心は,ポイントの値を設定して大幅な変動を認識し,突破確認後に相応の方向での取引である.戦略には,リスク管理可能な自動取引を実現するために,厳格な時間管理,ストップ・ロス,取引管理の仕組みが含まれている.

戦略原則

戦略は有効な取引信号を識別するために複数のフィルターメカニズムを使用する. まず,戦略は30分毎のK線の閉鎖時に実体波動の範囲を計算し,波動幅がデフォルトの値を超えると潜在的な取引機会としてマークされます. 戦略の有効性を確保するために,戦略は追加のバッファローズポイントを設定し,価格がこのバッファローズ領域を突破したときにのみ実際の取引信号を触発します.

戦略的優位性

  1. 優れた時間管理: 取引時間ウィンドウを制限し,非アクティブな時間の偽信号を避ける
  2. 双方向取引メカニズム:市場の双方向の機会を捉え,資金の利用効率を向上させる
  3. リスク管理の改善: リスク評価と管理を容易にするために,固定ポイントのストップストローを使用
  4. 高度な自動化: 信号認識から取引実行までの全過程を自動化し,人間の介入を減らす
  5. フレキシブルなパラメータ設定:異なる市場環境に対応するために,重要なパラメータを調整できます.

戦略リスク

  1. 偽突破リスク:大きな波動の後,偽突破が発生し,オフを停止する可能性があります.
  2. パラメータの感受性:不適切な値設定は,機会を逃したり,過度に取引したりする可能性があります.
  3. 市場環境依存性: 変動する市場では,頻繁にストップ・ロスを引き起こす可能性があります.
  4. スライドポイント影響:高波動期間の間,実際の取引価格は,シグナル価格から大きく偏っている可能性があります
  5. 資金管理のリスク:ポジション管理の欠如は,リスクの過剰な開口につながる可能性があります.

戦略最適化の方向性

  1. トレンドフィルターを追加: 長いサイクルのトレンド指標と組み合わせて,信号の質を向上させる
  2. ダイナミックパラメータ最適化:市場の変動に応じて,減値とストップ・ローズパラメータを自動的に調整する
  3. 交付量確認の導入:交付量フィルタリング条件を高め,突破信頼性を向上させる
  4. ストップ・ストップを最適化: ダイナミックなストップ・ストップを実現し,異なる市場環境に対応
  5. ポジション管理に追加:シグナル強さや市場の変動率に応じてポジションを動的に調整する

要約する

これは,設計が整え,論理が明瞭な自動取引戦略である.厳格な条件フィルタリングとリスク制御により,戦略は実用性が高い.しかし,まだ,実体で充分なテストと最適化が必要である.特に,パラメータ設定とリスク制御に関しては,実際の市場状況に合わせて調整する必要がある.戦略の成功運用には,安定した市場環境と適切なパラメータ配置が必要である.実体での使用の前に十分な裏返しテストが推奨されている.

ストラテジーソースコード
/*backtest
start: 2024-10-01 00:00:00
end: 2024-10-31 23:59:59
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("Big Candle Breakout Strategy Both Side", overlay=true)  

// Input for the point move threshold
point_move_in = input.int(100, title="Point Move Threshold")
point_target = input.int(100, title="Point Target")
point_stoploss = input.int(100, title="Point Stop Loss")
point_buffer = input.int(5, title="Point Buffer")

point_move = point_buffer + point_move_in

// Define the start and end times for trading
start_hour = 9
start_minute = 15
end_hour = 14
end_minute = 30

// Function to check if the current time is within the allowed trading window
in_time_range = (hour(time('30')) > start_hour or (hour(time('30')) == start_hour and minute(time('30')) >= start_minute)) and (hour(time('30')) < end_hour or (hour(time('30')) == end_hour and minute(time('30')) <= end_minute))

// Retrieve the open, high, low, and close prices of 30-minute candles
open_30m = request.security(syminfo.tickerid, "30", open)
high_30m = request.security(syminfo.tickerid, "30", high)
low_30m = request.security(syminfo.tickerid, "30", low)
close_30m = request.security(syminfo.tickerid, "30", close)

// Calculate the range of the candle
candle_range_long = (close_30m - open_30m)
candle_range_short = (open_30m - close_30m)

// Determine if the candle meets the criteria to be marked
big_candle_long = candle_range_long >= point_move_in
big_candle_short = candle_range_short >= point_move_in

// Variables to store the state of the trade
var float long_entry_price = na
var float long_target_price = na
var float long_stop_loss_price = na

var float short_entry_price = na
var float short_target_price = na
var float short_stop_loss_price = na

// Check if there are no active trades
no_active_trades = (strategy.opentrades == 0)

// Long entry condition
if (big_candle_long and na(long_entry_price) and in_time_range and no_active_trades)
    long_entry_price := high_30m+point_buffer
    long_target_price := long_entry_price + point_target
    long_stop_loss_price := long_entry_price - point_stoploss
    strategy.entry("Buy", strategy.long, stop=long_entry_price, limit=long_target_price)

plot(long_entry_price, style=plot.style_linebr, color=color.blue, linewidth=2, title="Entry Price")
plot(long_target_price, style=plot.style_linebr, color=color.green, linewidth=2, title="Target Price")
plot(long_stop_loss_price, style=plot.style_linebr, color=color.red, linewidth=2, title="Stop Loss Price")

// Short entry condition
if (big_candle_short and na(short_entry_price) and in_time_range and no_active_trades)
    short_entry_price := low_30m - point_buffer
    short_target_price := short_entry_price - point_target
    short_stop_loss_price := short_entry_price + point_stoploss
    strategy.entry("Sell", strategy.short, stop=short_entry_price, limit=short_target_price)

plot(short_entry_price, style=plot.style_linebr, color=color.blue, linewidth=2, title="Short Entry Price")
plot(short_target_price, style=plot.style_linebr, color=color.green, linewidth=2, title="Short Target Price")
plot(short_stop_loss_price, style=plot.style_linebr, color=color.red, linewidth=2, title="Short Stop Loss Price") 

// Long exit conditions
if (not na(long_entry_price))
    strategy.exit("Long Exit", from_entry="Buy", limit=long_target_price, stop=long_stop_loss_price)
   
// Short exit conditions
if (not na(short_entry_price))
    strategy.exit("Short Exit", from_entry="Sell", limit=short_target_price, stop=short_stop_loss_price)

// Reset trade status
if (strategy.position_size == 0)
    long_entry_price := na
    long_target_price := na
    long_stop_loss_price := na

    short_entry_price := na
    short_target_price := na
    short_stop_loss_price := na

// Plot the big candle and entry/exit levels
plotshape(series=big_candle_long, location=location.abovebar, style=shape.circle, color=color.green)
plotshape(series=big_candle_short, location=location.abovebar, style=shape.circle, color=color.red)

//plot(long_entry_price, style=plot.style_stepline, color=color.blue, linewidth=2, title="Entry Price")
//plot(long_target_price, style=plot.style_stepline, color=color.green, linewidth=2, title="Target Price")
//plot(long_stop_loss_price, style=plot.style_stepline, color=color.red, linewidth=2, title="Stop Loss Price")