
この戦略は、ボリンジャー バンド インジケーターに基づいた適応型トレンド反転取引システムです。価格とボリンジャーバンドのクロスオーバーを監視して、市場の買われすぎと売られすぎの機会を捉え、平均回帰の原理に基づいて取引を行います。この戦略は、動的なポジション管理とリスク制御メカニズムを採用しており、複数の市場と期間に適用できます。
戦略の中核となるロジックは、次の点に基づいています。
不安定な市場のリスク - 横ばい市場での頻繁な取引は損失につながる可能性があります。 解決策: トレンド フィルターを追加し、トレンドが明確な場合にのみ取引を行います。
誤ったブレイクアウトのリスク - ブレイクアウト後に価格が急速に反転する可能性があります。 解決策: ボリュームやその他のテクニカル指標などの確認シグナルを追加します。
システマティック リスク - 極端な市場状況下で大きな損失が発生する可能性。 解決策: 最大ドローダウン制限を設定し、しきい値に達すると自動的に取引を停止します。
この戦略では、ボリンジャー バンド インジケーターを使用して価格の偏差を捕捉し、それを平均回帰原理と組み合わせて取引します。完璧なリスク管理メカニズムと明確な取引ルールにより、非常に実用的です。推奨される最適化の方向性を通じて、戦略の安定性と収益性をさらに向上させることができます。この戦略は、安定した収益を求める定量的トレーダーに適しています。
/*backtest
start: 2025-01-09 00:00:00
end: 2025-01-16 00:00:00
period: 10m
basePeriod: 10m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT","balance":49999}]
*/
//@version=5
strategy("Bollinger Bands Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=200)
// Inputs for Bollinger Bands
bbLength = input.int(20, title="Bollinger Bands Length")
bbStdDev = input.float(2.0, title="Bollinger Bands StdDev")
// Inputs for Risk Management
stopLossPerc = input.float(1.0, title="Stop Loss (%)", minval=0.1, step=0.1)
takeProfitPerc = input.float(2.0, title="Take Profit (%)", minval=0.1, step=0.1)
// Calculate Bollinger Bands
basis = ta.sma(close, bbLength)
bbStdev = ta.stdev(close, bbLength)
upper = basis + bbStdDev * bbStdev
lower = basis - bbStdDev * bbStdev
// Plot Bollinger Bands
plot(basis, color=color.blue, title="Middle Band")
plot(upper, color=color.red, title="Upper Band")
plot(lower, color=color.green, title="Lower Band")
// Entry Conditions
longCondition = ta.crossover(close, lower)
shortCondition = ta.crossunder(close, upper)
// Exit Conditions
exitLongCondition = ta.crossunder(close, basis)
exitShortCondition = ta.crossover(close, basis)
// Stop Loss and Take Profit Levels
longStopLoss = close * (1 - stopLossPerc / 100)
longTakeProfit = close * (1 + takeProfitPerc / 100)
shortStopLoss = close * (1 + stopLossPerc / 100)
shortTakeProfit = close * (1 - takeProfitPerc / 100)
// Execute Long Trades
if (longCondition)
strategy.entry("Long", strategy.long)
strategy.exit("Exit Long", from_entry="Long", stop=longStopLoss, limit=longTakeProfit)
if (shortCondition)
strategy.entry("Short", strategy.short)
strategy.exit("Exit Short", from_entry="Short", stop=shortStopLoss, limit=shortTakeProfit)
// Close Positions on Exit Conditions
if (exitLongCondition and strategy.position_size > 0)
strategy.close("Long")
if (exitShortCondition and strategy.position_size < 0)
strategy.close("Short")
// 🔊 SOUND ALERTS IN BROWSER 🔊
if (longCondition)
alert("🔔 Long Entry Signal!", alert.freq_once_per_bar_close)
if (shortCondition)
alert("🔔 Short Entry Signal!", alert.freq_once_per_bar_close)
if (exitLongCondition)
alert("🔔 Closing Long Trade!", alert.freq_once_per_bar_close)
if (exitShortCondition)
alert("🔔 Closing Short Trade!", alert.freq_once_per_bar_close)