볼린저 밴드 고빈도 정량 전략과 고점과 저점을 돌파하는 롱숏 전략을 결합

BB SMA SD RR HH LL
생성 날짜: 2024-12-04 15:15:50 마지막으로 수정됨: 2024-12-04 15:15:50
복사: 2 클릭수: 564
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

볼린저 밴드 고빈도 정량 전략과 고점과 저점을 돌파하는 롱숏 전략을 결합

개요

이 전략은 부린띠 지표와 가격 돌파구를 결합한 고주파 거래 시스템이다. 전략은 가격과 부린띠의 위치 관계를 모니터링하여, 이전 고저점 돌파구 신호와 결합하여, 시장에서 과매매가 발생했을 때 역전 거래한다. 시스템은 1:1의 위험 이득 비율을 채택하고, 스톱 손실을 설정하고, 시각적으로 각 핵심 가격을 표시하여, 거래자가 시장 움직임을 직관적으로 이해하도록 돕는다.

전략 원칙

이 전략의 핵심 논리는 두 가지 주요 판단 조건에 기반합니다: 가격이 이전 고점을 돌파하고 이전 고점은 브린 밴드 아래의 경로에있을 때, 여러 신호를 트리거합니다. 가격이 이전 저점을 넘어서는 경우, 이전 저점은 브린 밴드 위 경로에있을 때, 빈 신호를 트리거합니다. 브린 밴드 매개 변수는 20 주기의 이동 평균과 2 배의 표준 차이를 사용하여 시장의 변동 범위를 판단합니다.

전략적 이점

  1. 트렌드 브레이크와 평균값 회귀를 결합하여 다양한 시장 환경에서 안정성을 유지할 수 있습니다.
  2. 고정된 리스크/이익 비율을 사용하여 포지션 관리를 함으로써 장기적으로 안정적인 수익을 창출할 수 있다.
  3. 입점, 정지 및 목표 지점을 시각적으로 보여줌으로써 전략의 실행성을 향상시킵니다.
  4. 브린 띠 지표의 사용은 시장의 과매매 현상을 식별하는 데 도움을 주며 거래의 정확성을 향상시킵니다.
  5. 전략의 논리는 간단하고 명확하며 이해하기 쉽고 실행하기 쉽습니다.

전략적 위험

  1. 높은 주파수 거래는 높은 거래 비용에 직면할 수 있으며 수수료의 영향을 고려해야합니다.
  2. 수평 변동 시장에서 빈번한 가짜 브레이크 신호가 발생할 수 있습니다.
  3. 고정된 리스크/이익 비율은 큰 추세를 제대로 파악하지 못할 수도 있습니다.
  4. 모든 시장 환경에 부린 밴드 매개 변수가 고정되지 않을 수 있습니다.
  5. 실시간 시장 모니터링이 필요한데, 이는 신호의 적시에 실행될 수 있도록 보장합니다.

전략 최적화 방향

  1. 신호확인으로 통환량 지표를 도입하여 돌파의 신뢰성을 높인다.
  2. 시장의 변동에 따라 부린 대역변수 조정
  3. 트렌드 필터를 추가하여 수평 시장에서 자주 거래하는 것을 피하십시오.
  4. 시간 필터링을 추가하여 비활성 상태에서 거래하는 것을 피하십시오.
  5. 적응적 위험/수익 대비 설정 메커니즘 개발

요약하다

이것은 여러 가지 기술적 분석 개념을 통합 한 완전한 거래 시스템입니다. 부린 벨트 지표와 가격 돌파구를 결합하는 방식으로 전략은 시장의 과매도 과 판매 영역에서 역전 기회를 잡을 수 있습니다. 약간의 최적화 공간이 있지만 시스템의 기본 프레임 워크는 좋은 확장성과 실용적 가치를 가지고 있습니다. 합리적인 위험 관리 및 매개 변수 최적화를 통해 전략은 실제 거래에서 안정적인 수익을 얻을 수 있습니다.

전략 소스 코드
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-03 00:00:00
period: 2d
basePeriod: 2d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("Bollinger Band Scalping", overlay=true)

// Input for Bollinger Bands length and standard deviation
bbLength = input(20, title="Bollinger Bands Length")
stdDev = input(2.0, title="Bollinger Bands Std Dev")

// Calculate and plot the Bollinger Bands
basis = ta.sma(close, bbLength)
deviation = stdDev * ta.stdev(close, bbLength)
upperBB = basis + deviation
lowerBB = basis - deviation

// Get previous candle's values
prevHigh = high[1]   // Previous candle high
prevLow = low[1]     // Previous candle low

// Buy Signal Condition: Current high crossed above previous high and previous high is below the lower Bollinger Band
buyCondition = ta.crossover(high, prevHigh) and (prevHigh < lowerBB[1])

// Sell Signal Condition: Current low crossed below previous low and previous low is above the upper Bollinger Band
sellCondition = ta.crossunder(low, prevLow) and (prevLow > upperBB[1])

// Entry and exit for Buy signals
if (buyCondition)
    strategy.entry("Buy", strategy.long)
    // Calculate target and stop loss
    stopLossPrice = prevLow
    targetPrice = prevHigh + (prevHigh - stopLossPrice)  // 1:1 RR target

    // Set stop loss and target orders
    strategy.exit("Sell", "Buy", limit=targetPrice, stop=stopLossPrice)

    // // Plot entry line
    // line.new(x1=bar_index, y1=prevHigh, x2=bar_index + 12, y2=prevHigh, color=color.green, width=2, style=line.style_solid)
    // // Plot stop loss line
    // line.new(x1=bar_index, y1=stopLossPrice, x2=bar_index + 12, y2=stopLossPrice, color=color.red, width=1, style=line.style_dashed)
    // // Plot target line
    // line.new(x1=bar_index, y1=targetPrice, x2=bar_index + 12, y2=targetPrice, color=color.blue, width=2, style=line.style_solid)

// Entry and exit for Sell signals
if (sellCondition)
    strategy.entry("Sell", strategy.short)
    // Calculate target and stop loss
    stopLossPriceSell = prevHigh
    targetPriceSell = prevLow - (stopLossPriceSell - prevLow)  // 1:1 RR target

    // Set stop loss and target orders
    strategy.exit("Cover", "Sell", limit=targetPriceSell, stop=stopLossPriceSell)

    // // Plot entry line
    // line.new(x1=bar_index, y1=prevLow, x2=bar_index + 12, y2=prevLow, color=color.red, width=2, style=line.style_solid)
    // // Plot stop loss line
    // line.new(x1=bar_index, y1=stopLossPriceSell, x2=bar_index + 12, y2=stopLossPriceSell, color=color.green, width=1, style=line.style_dashed)
    // // Plot target line
    // line.new(x1=bar_index, y1=targetPriceSell, x2=bar_index + 12, y2=targetPriceSell, color=color.blue, width=2, style=line.style_solid)

// Plotting Bollinger Bands with 70% transparency
plot(upperBB, color=color.red, title="Upper Bollinger Band", transp=70)
plot(lowerBB, color=color.green, title="Lower Bollinger Band", transp=70)
plot(basis, color=color.blue, title="Middle Band", transp=70)