
Die Strategie ist ein auf Bollinger Bands basierendes, hochwertiges, quantitatives Trading-System, das mit einem dynamischen Stop-Loss-Mechanismus kombiniert wird. Die Strategie ist darauf ausgerichtet, die Marktdynamik durch einen Bollinger-Abschuss zu erfassen, während die Stop-Loss-Strategie auf Basis von Punkten (Pips) eingeführt wird, um das Risiko zu verwalten. Die Strategie ist für verschiedene Handelsvarianten geeignet und kann durch Parameteroptimierung an verschiedene Marktumgebungen angepasst werden.
Die Strategie basiert hauptsächlich auf folgenden Kernprinzipien:
Es handelt sich um eine gut konzipierte quantitative Handelsstrategie, die Marktchancen durch Brin-Band-Breakthroughs erfasst und durch ein wissenschaftliches Risikomanagementsystem unterstützt wird. Die Strategie ist gut skalierbar und anpassungsfähig und kann durch empfohlene Optimierungsrichtungen weiter verbessert werden.
/*backtest
start: 2022-02-09 00:00:00
end: 2025-02-06 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Enhanced Bollinger Bands Strategy with SL/TP", overlay=true,
slippage=2)
// 入力パラメータの改善
length = input.int(20, "SMA Length", minval=1)
mult = input.float(2.0, "Standard Deviation Multiplier", minval=0.001, maxval=50)
enableLong = input.bool(true, "Enable Long Positions")
enableShort = input.bool(true, "Enable Short Positions")
pipValue = input.float(0.0001, "Pip Value", step=0.00001)
slPips = input.float(10, "Stop Loss (Pips)", minval=0)
tpPips = input.float(20, "Take Profit (Pips)", minval=0)
showBands = input.bool(true, "Show Bollinger Bands")
showSignals = input.bool(true, "Show Entry Signals")
// ボリンジャーバンド計算
basis = ta.sma(close, length)
dev = mult * ta.stdev(close, length)
upper = basis + dev
lower = basis - dev
// 可視化
plot(showBands ? basis : na, "Basis", color=color.blue)
u = plot(showBands ? upper : na, "Upper", color=color.red)
l = plot(showBands ? lower : na, "Lower", color=color.green)
fill(u, l, color=color.new(color.purple, 90))
// エントリー条件の改善
longCondition = ta.crossover(close, lower) and close > lower and enableLong
shortCondition = ta.crossunder(close, upper) and close < upper and enableShort
// ポジション管理
calcSlPrice(price, isLong) => isLong ? price - slPips * pipValue : price + slPips * pipValue
calcTpPrice(price, isLong) => isLong ? price + tpPips * pipValue : price - tpPips * pipValue
// エントリー&エグジットロジック
if longCondition
strategy.entry("Long", strategy.long, limit=lower)
strategy.exit("Long Exit", "Long",
stop=calcSlPrice(lower, true),
limit=calcTpPrice(lower, true))
if shortCondition
strategy.entry("Short", strategy.short, limit=upper)
strategy.exit("Short Exit", "Short",
stop=calcSlPrice(upper, false),
limit=calcTpPrice(upper, false))
// シグナル可視化
plotshape(showSignals and longCondition, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
plotshape(showSignals and shortCondition, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)