
이 전략은 부린띠 지표에 기반하며, 주요 아이디어는 가격이 부린띠를 뚫고 궤도에 오르거나 내리면, 가격이 부린띠 내부로 돌아가는 것을 기다린 다음, 회귀 지점에서 뚫린 방향과 동일한 위치를 구축하는 것이다. 이 전략은 부린띠의 뚫림과 회귀의 조합 조건을 통해 시장의 전환점을 포착하기 위해 극단적인 지역에서 가격이 반전되는 특징을 이용한다. 더 높은 승률을 얻기 위해.
브린띠 돌파 회귀 거래 전략은 간단한 실용적인 수량 거래 전략이다. 그것은 극단적인 상황에 대한 가격의 반응을 이용하고, 브린띠 도구를 통해 평점 조건을 구축하고, 트렌드 시작과 끝점을 어느 정도 잡을 수 있으며, 빈번한 거래를 제어한다. 이 전략에는 또한 파라미터 선택, 충격적 인 상황에서의 열악한 성능, 트렌드 파악 부족 등의 문제가 있습니다. 세부 사항의 최적화 및 다른 신호와 결합하여 전략의 적응성과 무모성을 더욱 향상시킬 수 있습니다.
/*backtest
start: 2024-02-01 00:00:00
end: 2024-02-27 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy(shorttitle="BB", title="Bollinger Bands", overlay=true)
length = input.int(20, minval=1)
maType = input.string("SMA", "Basis MA Type", options = ["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"])
src = input(close, title="Source")
mult = input.float(1.7, minval=0.001, maxval=50, title="StdDev")
ma(source, length, _type) =>
switch _type
"SMA" => ta.sma(source, length)
"EMA" => ta.ema(source, length)
"SMMA (RMA)" => ta.rma(source, length)
"WMA" => ta.wma(source, length)
"VWMA" => ta.vwma(source, length)
basis = ma(src, length, maType)
dev = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev
offset = input.int(0, "Offset", minval = -500, maxval = 500)
plot(basis, "Basis", color=#FF6D00, offset = offset)
p1 = plot(upper, "Upper", color=#2962FF, offset = offset)
p2 = plot(lower, "Lower", color=#2962FF, offset = offset)
fill(p1, p2, title = "Background", color=color.rgb(33, 150, 243, 95))
break_up = close > upper
break_down = close < lower
inside = close > lower and close < upper
sell_condition = break_up[1] and inside
buy_condition = break_down[1] and inside
// Conditions to close trades
close_sell_condition = close > basis
close_buy_condition = close < basis
trade_condition = sell_condition or buy_condition
// Tracking the high of the breakout candle
var float peak = na
if (not trade_condition)
peak := close
if (break_up and peak < high)
peak := high
if (break_down and peak > low)
peak := low
// Entering positions
if (buy_condition)
strategy.entry("Buy", strategy.long)
if (sell_condition)
strategy.entry("Sell", strategy.short)
// Exiting positions when close crosses the basis
if (strategy.position_size > 0 and close_sell_condition) // If in a long position and close crosses above basis
strategy.close("Buy")
if (strategy.position_size < 0 and close_buy_condition) // If in a short position and close crosses below basis
strategy.close("Sell")