波動性ブレイク・トレード戦略

作者: リン・ハーンチャオチャン開催日:2023年10月30日 16:58:03
タグ:

img

概要

波動性ブレイクアウト取引戦略は,市場の波動性の増加による価格ブレイクを捕捉することを目的としている.この戦略は,特定の期間にわたって資産の波動性を測定するために平均真要範囲 (ATR) 指標を使用する.価格はATRによって決定された2つのレベルを超えたり下回ったりすると,ロングとショートシグナルが生成される.

戦略の論理

ストラテジーは,最初に選択された期間中にATRを計算する.その後,ATRを使用して上下ブレイクレベルを計算する.閉じる価格が上位値を超えると,ロング信号が生成される.閉じる価格が下位値を下回ると,ショート信号が生成される.信号をさらに確認するには,現在のバーがボディ部分に閉じる必要があります.

閉じる価格が上位または下位を突破すると,ブレイクゾーンはブレイク方向を示す色で満たされます.この機能は,支配的なトレンド方向を迅速に識別するのに役立ちます.

ロング信号が生成され,現在のポジションがない場合,戦略はロングになります.ショート信号が生成され,現在のポジションがない場合,戦略はショートになります.

長度入力では,波動性が測定される期間を決定する.長度値が高くなった場合,より長い価格動向に焦点を当てることを意味します.例えば,長度が20に設定されている場合,各取引は約100バーを網羅し,複数の振動を記録します.

長さの値を下げることで,短期的な価格動向を標的にし,取引頻度を増やす可能性がある.長さの入力と平均的な取引長さの間には厳格な相関性がない.最適な長さの値は実験を通じて見つけなければならない.

利点分析

この戦略は,市場の変動から生じる重要な動きを把握するためにブレイクアウト原則を活用しています.ATR指標は固定パラメータを使用するのではなく,ブレイクアウトレベルを動的に計算します.

確認信号の固いバーの閉ざしを用いて 偽のブレイクアウトをフィルタリングします

長さ入力では,特定の市場条件に戦略を最適化するための柔軟性を提供します.

リスク分析

ブレイクトレードにはストップアウトのリスクがあります.ストップロスは個々のトレードでの損失を制御できます.

ブレイクシグナルは,過剰取引につながる偽信号を生成することがあります. 偽信号をフィルターアウトするために長さの値を調整できます.

パラメータ最適化には十分な取引データが必要である.初期パラメータが不十分である場合,パフォーマンスが低下する可能性があります.

最適化 の 機会

ATR 期間中にボリンジャー・バンドを導入して新しいブレイクアウトレベルを計算できます.ボリンジャー・ブレイクアウトは誤った信号を減らすことができます.

突破後もトレンドを追跡できます.すぐに停止するのではなく.後退停止を組み込むことができます.

バランス・バインド市場では,異なるパラメータや取引を完全に回避することが考えられます.

結論

波動性ブレイクアウト・トレーディング戦略は,価格が著しくブレイクされたときにトレンド動きに入るために市場波動性の増加を活用する.ATR指標は動的にブレイクアウトレベルを設定し,固いバーは偽ブレイクアウトをフィルターする.長さ入力は戦略の期間を調整する柔軟性を提供します.戦略は中長期のトレンドフォローに適していますが,パラメータ最適化によってブレイクアウトリスクを管理する必要があります.


/*backtest
start: 2023-09-29 00:00:00
end: 2023-10-29 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/

//@version=5
strategy("Volatility Breakout Strategy [Angel Algo]", overlay = true)

// Inputs
length = input(title="Length", defval=20)

// Calculate the average true range (ATR)
atr = ta.atr(length)

// Plot the ATR on the chart
plot(atr, color=color.blue, linewidth=2, title="ATR")

// Calculate the upper and lower breakouts
upper_breakout = high + atr
lower_breakout = low - atr

// Plot the upper and lower breakouts on the chart
ul = plot(upper_breakout[1], color = color.new(color.green, 100), linewidth=2, title="Upper Breakout Level")
ll = plot(lower_breakout[1], color = color.new(color.red, 100), linewidth=2, title="Lower Breakout Level")

// Create the signals
long_entry = ta.crossover(close, upper_breakout[1]) and barstate.isconfirmed
short_entry = ta.crossunder(close, lower_breakout[1]) and barstate.isconfirmed

active_signal_color =ta.barssince(long_entry) < ta.barssince(short_entry) ? 
   color.new(color.green,85) : color.new(color.red,85)

// Plot the signals on the chart
plotshape(long_entry and ta.barssince(long_entry[1]) > ta.barssince(short_entry[1]), location=location.belowbar, style=shape.triangleup, 
   color=color.green, size=size.normal, text = "Bullish breakout", textcolor = color.green)
plotshape(short_entry and ta.barssince(long_entry[1]) < ta.barssince(short_entry[1]), location=location.abovebar, style=shape.triangledown, 
   color=color.red, size=size.normal,text = "Bearish breakout",  textcolor = color.red)

// Fill the space between the upper and lower levels with the color that indicates the latest signal direction
fill(ul,ll, color=active_signal_color)   

long_condition = long_entry and strategy.position_size <= 0 and barstate.isconfirmed
short_condition = short_entry and strategy.position_size >= 0 and barstate.isconfirmed

if long_condition
    strategy.entry("Volatility Breakout Long", strategy.long)


if short_condition
    strategy.entry("Volatility Breakout Short", strategy.short)


もっと