
この戦略は、ボリンジャー バンド インジケーターに基づく定量取引システムであり、ダイナミック レンジのブレークスルー シグナルを通じて市場の動向を捉えます。この戦略では、標準偏差チャネルをコア指標として使用し、それをファンド管理システムと組み合わせて、すべてのポジションの動的な調整を実現します。全体的な設計は、リスク管理と安定した収益の追求に重点を置いています。
この戦略では、20 期間の移動平均を中心軸として使用し、上下の標準偏差の 2 倍を使用して動的チャネルを形成します。価格が下限を突破すると、売られすぎのシグナルとみなされ、システムはすべての株を買います。価格が上限を突破すると、買われすぎのシグナルとみなされ、システムはすべての株を売ります。ボラティリティは標準偏差によって測定され、取引シグナルの動的な適応性を保証します。同時に、この戦略は資金管理システムを統合し、口座残高に応じてポジションサイズを自動的に調整します。さらに、この戦略には、WebHook と取引所を通じて自動的に実行できる自動取引インターフェースも含まれています。
この戦略は、ボリンジャーバンドのテクニカル指標を通じて、資金管理と自動実行を組み合わせた完全な定量取引システムを構築し、高い実用性を備えています。一定の制限はあるものの、推奨される最適化の方向性を通じて、戦略の安定性と収益性をさらに向上させることができます。この戦略は、ボラティリティの高い市場環境に適しており、安定した収益を追求する投資家にとって参考となる価値があります。
/*backtest
start: 2024-11-26 00:00:00
end: 2024-12-25 08:00:00
period: 3h
basePeriod: 3h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Bollinger Bands Strategy", overlay=true, initial_capital=86, default_qty_type=strategy.percent_of_equity)
// Parameter für die Bollinger-Bänder
length = input.int(20, title="Bollinger Bands Length")
mult = input.float(2.0, title="Bollinger Bands Multiplier")
// Berechnung der Bollinger-Bänder
basis = ta.sma(close, length)
upper = basis + mult * ta.stdev(close, length)
lower = basis - mult * ta.stdev(close, length)
// Startkapital
usdt_balance = 86.0 // Anfangsbetrag in USDT
zerebro_balance = 52.0 // Anfangsbetrag in ZEREBRO
// Bedingungen für Kauf- und Verkaufssignale
longCondition = ta.crossover(close, lower)
shortCondition = ta.crossunder(close, upper)
// Kauf- und Verkaufslogik
if (longCondition and usdt_balance > 0)
strategy.entry("Buy", strategy.long, qty=usdt_balance / close)
usdt_balance := 0 // Alle USDT werden verwendet
zerebro_balance += strategy.position_size // Gekaufte ZEREBRO hinzufügen
if (shortCondition and zerebro_balance > 0)
strategy.close("Buy")
usdt_balance += strategy.position_size * close // Verkaufserlös in USDT
zerebro_balance := 0 // Alle ZEREBRO verkauft
// Plot der Bollinger-Bänder
plot(basis, color=color.blue, title="Basis")
plot(upper, color=color.green, title="Upper Band")
plot(lower, color=color.red, title="Lower Band")
// Alerts für Bybit-Verbindung
alertcondition(longCondition, title="Buy Alert", message='{"action": "buy", "symbol": "ZEREBRO/USDT"}')
alertcondition(shortCondition, title="Sell Alert", message='{"action": "sell", "symbol": "ZEREBRO/USDT"}')
// Automatische Verknüpfung mit Bybit
// Stellen Sie sicher, dass Sie den Webhook-URL in TradingView einstellen und korrekt mit Bybit verbinden.