이 전략은 주로 브린을 통해 시장의 변동 영역을 식별하고, 동시에 슈퍼 트렌드 지표를 사용하여 시장의 경향 방향을 확인하여 높은 확률 위치에서 거래합니다. 전략은 다양한 거래 품종과 시간 주기, 특히 30 분 및 2 시간 주기에서 잘 작동합니다.
전략의 핵심 논리는 다음과 같은 핵심 요소에 기초합니다.
이것은 기술 분석의 클래식 지표와 결합된 완전한 거래 시스템이며, 브린 밴드와 슈퍼 트렌드의 연동으로 트렌드와 변동 모두에서 좋은 성능을 발휘할 수 있다. 전략의 시각화 설계와 파라미터 유연성은 훌륭한 실용성을 갖는다. 제안된 최적화 방향을 통해 전략의 안정성과 수익성을 더욱 향상시킬 수 있다. 실제 사용 전에 충분한 피드백과 파라미터 최적화를 권장한다.
/*backtest
start: 2024-12-05 00:00:00
end: 2024-12-12 00:00:00
period: 5m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Bollinger Band & SuperTrend Strategy (Standard Chart)", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// Bollinger Bands Settings
length_bb = input.int(20, title="Bollinger Band Length")
mult_bb = input.float(2.0, title="Bollinger Band Multiplier")
[bb_upper, bb_basis, bb_lower] = ta.bb(close, length_bb, mult_bb)
// Median Bands
bb_median_upper = (bb_upper + bb_basis) / 2
bb_median_lower = (bb_lower + bb_basis) / 2
// SuperTrend Settings
atr_length = input.int(10, title="ATR Length")
factor = input.float(3.0, title="SuperTrend Factor")
// SuperTrend Calculation based on standard chart OHLC data
[supertrend, direction] = ta.supertrend(factor, atr_length)
// Plotting Bollinger Bands
plot(bb_upper, color=color.red, title="Bollinger Upper Band")
plot(bb_median_upper, color=color.orange, title="Bollinger Median Upper Band")
plot(bb_basis, color=color.blue, title="Bollinger Basis")
plot(bb_median_lower, color=color.purple, title="Bollinger Median Lower Band")
plot(bb_lower, color=color.green, title="Bollinger Lower Band")
// Plotting SuperTrend
supertrend_color = direction > 0 ? color.green : color.red
plot(supertrend, color=supertrend_color, style=plot.style_line, title="SuperTrend Line")
// Customizable Signal Shape Inputs
buy_shape = input.string("shape_triangle_up", title="Buy Signal Shape", options=["shape_triangle_up", "shape_circle", "shape_cross", "shape_diamond", "shape_flag"])
sell_shape = input.string("shape_triangle_down", title="Sell Signal Shape", options=["shape_triangle_down", "shape_circle", "shape_cross", "shape_diamond", "shape_flag"])
// Entry Conditions
buy_condition = ta.crossover(low, bb_lower) and direction > 0
sell_condition = ta.crossunder(high, bb_upper) and direction < 0
// Exit Conditions
exit_buy_condition = ta.crossunder(close, supertrend) and direction < 0
exit_sell_condition = ta.crossover(close, supertrend) and direction > 0
// Strategy Logic
if buy_condition
strategy.entry("Buy", strategy.long)
if sell_condition
strategy.entry("Sell", strategy.short)
if exit_buy_condition
strategy.close("Buy")
if exit_sell_condition
strategy.close("Sell")
// Plot Buy Signal Shape
plotshape(series=buy_condition, title="Buy Signal", location=location.belowbar, color=color.green, style=buy_shape, text="BUY", textcolor=color.white)
// Plot Sell Signal Shape
plotshape(series=sell_condition, title="Sell Signal", location=location.abovebar, color=color.red, style=sell_shape, text="SELL", textcolor=color.white)