ボリンジャー・バンド チャネル・ブレイク・アウト・ミニアン・リバース・戦略

作者: リン・ハーンチャオチャン開催日:2024年1月22日 10:47:45
タグ:

img

概要

これは,ボリンジャーバンドチャネルをベースとした平均逆転ブレイクアウト戦略である.価格がボリンジャーバンドの下部帯を下回ると,ロングになります.ストップロスはブレイクアウトバーの下部に設定されます.利益目標はボリンジャーバンド上部帯です.

戦略の論理

この戦略は,中帯,上帯,下帯からなる20期ボリンジャーバンドチャネルを使用している.中帯は20期単純な移動平均線である.上帯は中帯プラス2標準偏差である.下帯は中帯マイナス2標準偏差である.

価格が下帯を下回ると,価格が過剰販売状態に入っていることを示します.この時点で戦略は長引きます.ポジションに入ると,ストップロスはエントリーバーの下部に設定され,利益目標は上帯です.したがって,戦略は利益を得るために過剰販売から平均へのリバースプロセスを捉えることを目指します.

利点分析

この戦略の利点は次のとおりです.

  1. Bollinger Bands を使って,過買い/過売り状態を判断します.
  2. 逆転取引戦略,高値を追いかけるのを避け,低値を殺す
  3. 合理的なストップ・ロストと得益設定によりリスク管理が改善される

リスク分析

この戦略のリスクは以下のとおりです.

  1. ボリンジャー・バンドは価格動向を完璧に決定できないので ブレイクアウトは失敗する可能性があります
  2. 継続的な市場崩壊がストップロスを打つ可能性があります
  3. 高額なコストのリスクがある

オプティマイゼーションの方向性

戦略は以下の側面から改善できます.

  1. 最適な組み合わせを見つけるためにボリンジャー帯のパラメータを最適化
  2. 入力精度を向上させるためにフィルター指標を追加
  3. ストップ・ロスを最適化し,収益性を高めるために利益を取ります

結論

この戦略には明確な論理があり,ある程度取引可能である.しかし,ボリンジャーバンドでオーバーバイト/オーバーセールを判断する有効性は限られており,トレンドを完璧に決定することはできません.また,ストップ・ロスト・アンド・テイク・プロフィートメカニズムも改善する必要があります.今後は,より正確な指標を選択し,パラメータを調整し,収益性を向上させるために出口論理を強化することによって最適化することができます.


/*backtest
start: 2023-01-15 00:00:00
end: 2024-01-21 00:00:00
period: 1d
basePeriod: 1h
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/
// © Ronsword
//@version=5

strategy("bb 2ND target", overlay=true)
 
// STEP 1. Create inputs that configure the backtest's date range
useDateFilter = input.bool(true, title="Filter Date Range of Backtest",
     group="Backtest Time Period")
backtestStartDate = input(timestamp("1 Jan 1997"), 
     title="Start Date", group="Backtest Time Period",
     tooltip="This start date is in the time zone of the exchange " + 
     "where the chart's instrument trades. It doesn't use the time " + 
     "zone of the chart or of your computer.")
backtestEndDate = input(timestamp("1 Sept 2023"),
     title="End Date", group="Backtest Time Period",
     tooltip="This end date is in the time zone of the exchange " + 
     "where the chart's instrument trades. It doesn't use the time " + 
     "zone of the chart or of your computer.")

// STEP 2. See if the current bar falls inside the date range
inTradeWindow = true

// Bollinger Bands inputs
length = input.int(20, title="Bollinger Bands Length")
mult = input.float(2.0, title="Multiplier")
src = input(close, title="Source")
basis = ta.sma(src, length)
dev = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev

// EMA Settings
ema20 = ta.ema(close, 20)
plot(ema20, color=color.blue, title="20 EMA")

// Entry condition
longEntryCondition = ta.crossover(close, lower)

// Define stop loss level as the low of the entry bar
var float stopLossPrice = na
if longEntryCondition
    stopLossPrice := low

// Top Bollinger Band itself is set as the target
topBandTarget = upper

// Enter long position when conditions are met
if inTradeWindow and longEntryCondition
    strategy.entry("Long", strategy.long, qty=1)

// Set profit targets
strategy.exit("ProfitTarget2", from_entry="Long", limit=topBandTarget)

// Set stop loss
strategy.exit("StopLoss", stop=stopLossPrice)

// Plot Bollinger Bands with the same gray color
plot(upper, color=color.gray, title="Upper Bollinger Band")
plot(lower, color=color.gray, title="Lower Bollinger Band")



もっと