볼링거 밴드 채널 브레이크오웃 평균 역전 전략

저자:차오장, 날짜: 2024-01-22 10:47:45
태그:

img

전반적인 설명

이것은 볼링거 밴드 채널을 기반으로 한 평균 반전 브레이크 아웃 전략입니다. 가격이 볼링거 밴드의 하단 밴드 아래로 넘어갈 때 길게됩니다. 스톱 손실은 브레이크 아웃 바의 하단에 설정됩니다. 이익 목표는 볼링거 밴드의 상단입니다.

전략 논리

이 전략은 중간 밴드, 상위 밴드 및 하위 밴드로 구성된 20 기간 볼링거 밴드 채널을 사용합니다. 중간 밴드는 20 기간 간단한 이동 평균입니다. 상위 밴드는 중간 밴드 더하기 2 표준 편차입니다. 하위 밴드는 중간 밴드 마이너스 2 표준 편차입니다.

가격이 하위 대역 아래로 넘어가면 가격이 과판 상태로 들어갔음을 나타냅니다. 이 시점에서 전략은 길게 갈 것입니다. 포지션에 진입 한 후, 스톱 로스는 엔트리 바의 하단에 설정되며 이익 목표는 상위 대역입니다. 따라서 전략은 수익을 창출하기 위해 과판에서 평균으로 회귀 프로세스를 캡처하는 것을 목표로합니다.

이점 분석

이 전략의 장점은 다음과 같습니다.

  1. 일부 시기를 가진 과잉 구매/ 과잉 판매 상태를 판단하기 위해 볼링거 밴드를 사용
  2. 반전 거래 전략, 최고 추격 및 최저를 죽이는 것을 피하는
  3. 더 나은 위험 통제를 위해 합리적인 스톱 로스 및 수익 취득 설정

위험 분석

이 전략의 위험은 다음과 같습니다.

  1. 볼링거 대역은 가격 추세를 완벽하게 결정할 수 없습니다, 브레이크오웃은 실패 할 수 있습니다.
  2. 지속적인 시장 부진이 스톱 손실에 영향을 줄 수 있습니다.
  3. 상위 계단 근처에서 수익을 취하면 높은 비용의 위험이 있습니다.

최적화 방향

이 전략은 다음과 같은 측면에서 개선될 수 있습니다.

  1. 가장 좋은 조합을 찾기 위해 볼링거 밴드의 매개 변수를 최적화합니다.
  2. 입력 정확성을 향상시키기 위해 필터 표시기를 추가
  3. 더 높은 수익성을 위해 스톱 로스를 최적화하고 수익을 취하십시오.

결론

이 전략은 명확한 논리를 가지고 있으며 어느 정도 거래가 가능합니다. 그러나 볼링거 밴드 (Bollinger Bands) 로 과잉 구매/ 과잉 판매를 판단하는 효과는 제한되어 있으며, 트렌드를 완벽하게 결정할 수 없습니다. 또한, 스톱 로스 (stop loss) 및 영리 메커니즘은 개선이 필요합니다. 앞으로 더 정확한 지표를 선택하고 매개 변수를 조정하고 수익성을 향상시키기 위해 출구 논리를 향상시킴으로써 최적화 될 수 있습니다.


/*backtest
start: 2023-01-15 00:00:00
end: 2024-01-21 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Ronsword
//@version=5

strategy("bb 2ND target", overlay=true)
 
// STEP 1. Create inputs that configure the backtest's date range
useDateFilter = input.bool(true, title="Filter Date Range of Backtest",
     group="Backtest Time Period")
backtestStartDate = input(timestamp("1 Jan 1997"), 
     title="Start Date", group="Backtest Time Period",
     tooltip="This start date is in the time zone of the exchange " + 
     "where the chart's instrument trades. It doesn't use the time " + 
     "zone of the chart or of your computer.")
backtestEndDate = input(timestamp("1 Sept 2023"),
     title="End Date", group="Backtest Time Period",
     tooltip="This end date is in the time zone of the exchange " + 
     "where the chart's instrument trades. It doesn't use the time " + 
     "zone of the chart or of your computer.")

// STEP 2. See if the current bar falls inside the date range
inTradeWindow = true

// Bollinger Bands inputs
length = input.int(20, title="Bollinger Bands Length")
mult = input.float(2.0, title="Multiplier")
src = input(close, title="Source")
basis = ta.sma(src, length)
dev = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev

// EMA Settings
ema20 = ta.ema(close, 20)
plot(ema20, color=color.blue, title="20 EMA")

// Entry condition
longEntryCondition = ta.crossover(close, lower)

// Define stop loss level as the low of the entry bar
var float stopLossPrice = na
if longEntryCondition
    stopLossPrice := low

// Top Bollinger Band itself is set as the target
topBandTarget = upper

// Enter long position when conditions are met
if inTradeWindow and longEntryCondition
    strategy.entry("Long", strategy.long, qty=1)

// Set profit targets
strategy.exit("ProfitTarget2", from_entry="Long", limit=topBandTarget)

// Set stop loss
strategy.exit("StopLoss", stop=stopLossPrice)

// Plot Bollinger Bands with the same gray color
plot(upper, color=color.gray, title="Upper Bollinger Band")
plot(lower, color=color.gray, title="Lower Bollinger Band")



더 많은