볼린저 밴드 볼륨 추세 추종 양적 전략

BB RSI EMA SMA SD SL
생성 날짜: 2024-11-12 15:53:44 마지막으로 수정됨: 2024-11-12 15:53:44
복사: 1 클릭수: 459
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

볼린저 밴드 볼륨 추세 추종 양적 전략

개요

이 전략은 부린 띠, RSI 지표 및 이동 평균을 기반으로 한 통합 거래 시스템입니다. 전략은 부린 띠의 가격 변동 범위, RSI 초과 과매매 수준 및 EMA 트렌드 필터링을 통해 잠재적인 거래 기회를 식별합니다. 이 시스템은 더 많은 거래와 더 적은 거래를 지원하며 자금을 보호하기 위해 여러 가지 탈퇴 장치를 제공합니다.

전략 원칙

이 전략은 다음과 같은 핵심 구성 요소를 기반으로 합니다.

  1. 1.8배의 표준 차이의 브린을 사용하여 가격 변동 범위를 결정합니다.
  2. 7주기 RSI 지표를 사용하여 과매매를 판단합니다.
  3. 트렌드 필터로 선택 가능한 500주기 EMA
  4. 입장 조건:
    • RSI가 25보다 낮아지고 부린이 경계를 넘어섰습니다.
    • 공백: RSI가 75을 넘어서 부린을 돌파했다.
  5. 탈퇴 방법은 RSI 하락 또는 브린 반전 돌파를 지원합니다.
  6. 선택 가능한 상해 방지 비율

전략적 이점

  1. 다중 기술 지표의 연동은 신호 신뢰성을 향상시킵니다.
  2. 유연한 매개 변수 설정은 다른 시장 상황에 따라 조정할 수 있습니다.
  3. 양방향 거래를 지원하고, 시장 기회를 최대한 활용하라
  4. 다양한 거래 스타일에 맞게 다양한 탈퇴 메커니즘을 제공합니다.
  5. 트렌드 필터링 기능이 가짜 신호를 효과적으로 감소시킵니다.
  6. 손해배상 제도는 좋은 리스크 관리를 제공합니다.

전략적 위험

  1. 변동성이 큰 시장에서는 잘못된 신호가 자주 발생할 수 있습니다.
  2. 여러 지표로 인해 신호 지연이 발생할 수 있습니다.
  3. 고정된 RSI 경계는 시장 환경에 따라 충분히 유연하지 않을 수 있습니다.
  4. 브린 밴드 매개 변수는 시장의 변동에 따라 조정되어야 합니다.
  5. 스톱 손실 설정은 급격한 변동에 의해 쉽게 트리거 될 수 있습니다

전략 최적화 방향

  1. 시장의 변동에 따라 동적으로 조정되는 적응형 부린 대수
  2. 보조 확인으로 볼륨 표시기 추가
  3. 시간 필터를 추가하여 특정 시간대에 거래하는 것을 고려하십시오.
  4. 동적인 RSI 마이너스 시스템 개발
  5. 더 많은 트렌드 확인 지표를 통합합니다.
  6. 손해 차단 메커니즘을 최적화하고 동적 손해 차단을 고려합니다.

요약하다

이것은 여러 기술 지표의 조합을 통해 시장 기회를 포착하기 위해 잘 설계된 정량 거래 전략입니다. 전략은 구성성이 강하며 다양한 거래 요구에 적응 할 수 있습니다. 일부 고유한 위험이 있지만, 매개 변수를 최적화하고 보조 지표를 추가하면 안정성과 신뢰성을 더욱 향상시킬 수 있습니다. 체계화된 거래 방법을 찾는 투자자에게는 참고할 가치가있는 전략 프레임 워크입니다.

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

//@version=5
strategy("Bollinger Bands Scalp Pro", overlay=true)

// Inputs for the strategy
length = input(20, title="Bollinger Band Length")
src = input(close, title="Source")
mult = input(1.8, title="Bollinger Band Multiplier")
rsiLength = input(7, title="RSI Length")
rsiOverbought = input(75, title="RSI Overbought Level")
rsiOversold = input(25, title="RSI Oversold Level")

// Custom RSI exit points
rsiExitLong = input(75, title="RSI Exit for Long (Overbought)")
rsiExitShort = input(25, title="RSI Exit for Short (Oversold)")

// Moving Average Inputs
emaLength = input(500, title="EMA Length")
enableEMAFilter = input.bool(true, title="Enable EMA Filter")

// Exit method: Choose between 'RSI' and 'Bollinger Bands'
exitMethod = input.string("RSI", title="Exit Method", options=["RSI", "Bollinger Bands"])

// Enable/Disable Long and Short trades
enableLong = input.bool(true, title="Enable Long Trades")
enableShort = input.bool(false, title="Enable Short Trades")

// Enable/Disable Stop Loss
enableStopLoss = input.bool(false, title="Enable Stop Loss")
stopLossPercent = input.float(1.0, title="Stop Loss Percentage (%)", minval=0.1) / 100

// Bollinger Bands calculation
basis = ta.sma(src, length)
dev = mult * ta.stdev(src, length)
upperBB = basis + dev
lowerBB = basis - dev

// RSI calculation
rsi = ta.rsi(src, rsiLength)

// 200 EMA to filter trades (calculated but only used if enabled)
ema200 = ta.ema(src, emaLength)

// Long condition: RSI below oversold, price closes below the lower Bollinger Band, and optionally price is above the 200 EMA
longCondition = enableLong and (rsi < rsiOversold) and (close < lowerBB) and (not enableEMAFilter or close > ema200)
if (longCondition)
    strategy.entry("Long", strategy.long)

// Short condition: RSI above overbought, price closes above the upper Bollinger Band, and optionally price is below the 200 EMA
shortCondition = enableShort and (rsi > rsiOverbought) and (close > upperBB) and (not enableEMAFilter or close < ema200)
if (shortCondition)
    strategy.entry("Short", strategy.short)

// Stop Loss setup
if (enableStopLoss)
    strategy.exit("Long Exit", "Long", stop = strategy.position_avg_price * (1 - stopLossPercent))
    strategy.exit("Short Exit", "Short", stop = strategy.position_avg_price * (1 + stopLossPercent))

// Exit conditions based on the user's choice of exit method
if (exitMethod == "RSI")
    // Exit based on RSI
    exitLongCondition = rsi >= rsiExitLong
    if (exitLongCondition)
        strategy.close("Long")
    
    exitShortCondition = rsi <= rsiExitShort
    if (exitShortCondition)
        strategy.close("Short")
else if (exitMethod == "Bollinger Bands")
    // Exit based on Bollinger Bands
    exitLongConditionBB = close >= upperBB
    if (exitLongConditionBB)
        strategy.close("Long")
    
    exitShortConditionBB = close <= lowerBB
    if (exitShortConditionBB)
        strategy.close("Short")