모멘텀 멀티 지표 트렌드 추적 전략: 돈치안 채널 + 슈퍼 트렌드 + 볼륨 필터 위치 구축 시스템

DC ST MA VOL BO
생성 날짜: 2025-02-21 11:47:17 마지막으로 수정됨: 2025-02-21 11:47:17
복사: 0 클릭수: 565
avatar of ianzeng123 ianzeng123
2
집중하다
319
수행원

모멘텀 멀티 지표 트렌드 추적 전략: 돈치안 채널 + 슈퍼 트렌드 + 볼륨 필터 위치 구축 시스템 모멘텀 멀티 지표 트렌드 추적 전략: 돈치안 채널 + 슈퍼 트렌드 + 볼륨 필터 위치 구축 시스템

개요

이 전략은 돈치안 채널 (Donchian Channel) 을 뚫는 트렌드 추적 거래 시스템으로, 슈퍼 트렌드 지표 (SuperTrend) 와 거래량 필터를 결합하여 거래 신호의 신뢰성을 강화한다. 이 전략은 주로 가격의 역사적인 최고점을 돌파하는 방법을 통해 잠재적인 다중 거래 기회를 식별하며, 거래량 확인과 트렌드 추적 지표를 사용하여 가짜 돌파 신호를 필터링한다.

전략 원칙

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

  1. 동치안 통로: 사용자 정의 주기 내의 최고 가격과 최저 가격을 계산하여 상반, 하반, 중반을 형성한다. 가격이 상반을 돌파하면 다중 입문 신호를 유발한다.
  2. 거래량 필터: 현재 거래량을 20주기 이동 평균과 비교하여 거래량이 커질 때만 진출할 수 있도록 하여, 돌파구의 신뢰성을 높인다.
  3. 슈퍼 트렌드 지표: 트렌드 확인 도구로, 다중 헤드 트렌드에서는 녹색을, 공중 헤드 트렌드에서는 빨간색을 표시한다.
  4. 유연한 중지 메커니즘: 4 개의 다른 중지 옵션을 제공, 아래 경로 중지, 중간 경로 중지, 슈퍼 트렌드 중지 및 비율 추적 중지 포함.

전략적 이점

  1. 다중 신호 확인: 가격 돌파구, 거래량 확인 및 트렌드 지표와 결합하여 가짜 돌파구 위험을 크게 줄입니다.
  2. 적응력: 파라미터를 조정하여 다른 시장 환경과 거래 사이클에 적응할 수 있다.
  3. 리스크 관리가 잘 되어 있습니다. 시장 특성에 따라 가장 적합한 방법을 선택할 수 있습니다.
  4. 시각화 명확: 전략 인터페이스는 지표를 직관적으로 보여 주며, 거래자가 시장 상태를 쉽게 이해할 수 있습니다.
  5. 리포트 유연성: 리포트 시간 범위를 사용자 정의하여 전략을 최적화 할 수 있습니다.

전략적 위험

  1. 흔들림 시장 위험: 간격 흔들림 상황에서 빈번한 가짜 브레이크 신호가 발생할 수 있다.
  2. 슬라이드 포인트 위험: 유동성이 낮은 시장에서, 브레이크 신호는 슬라이드 포인트로 인해 진입 가격의 편향을 초래할 수 있다.
  3. 과도한 필터링 위험: 거래량 필터를 활성화하면 유효한 거래 기회를 놓칠 수 있습니다.
  4. 매개변수 민감도: 전략의 효과는 매개변수 설정에 민감하며 신중한 최적화가 필요합니다.

전략 최적화 방향

  1. 트렌드 강도 필터를 추가: 트렌드 강도 지표인 ADX를 추가할 수 있으며, 트렌드가 강할 때만 출전한다.
  2. 거래량 지표를 최적화: 상대적인 거래량이나 거래량 돌파구 지표를 사용하여 간단한 이동 평균을 대체하는 것을 고려할 수 있습니다.
  3. 시간 필터 추가: 거래 시간 창 설정을 추가하여 시장의 큰 변동이있는 시간을 피하십시오.
  4. 동적 변수 최적화: 시장의 변동에 따라 채널 사이클과 슈퍼 트렌드 변수를 자동으로 조정한다.
  5. 기계 학습을 도입: 기계 학습 알고리즘을 사용하여 매개 변수 선택 및 신호 필터링을 최적화하십시오.

요약하다

이 전략은 여러 가지 기술 지표를 통합하여 비교적 완벽한 트렌드 추적 거래 시스템을 구축했다. 이 전략의 장점은 신호의 신뢰성이 높고, 위험 관리가 유연하지만, 여전히 거래자가 특정 시장 특성에 따라 매개 변수를 최적화해야 한다는 것이다. 지속적인 개선과 최적화를 통해 이 전략은 트렌드 시장에서 안정적인 거래 효과를 얻을 것으로 보인다.

전략 소스 코드
/*backtest
start: 2024-10-01 00:00:00
end: 2025-02-19 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/

// Breakout trading system based on Donchain channel strategy that works best on a weekly chart and daily charts. Weekly is preferred. 

//@version=5

strategy('Donchian BO with Volume Filter and Supertrend', shorttitle='DBO+Vol+ST', default_qty_type=strategy.percent_of_equity, default_qty_value=2, overlay=true)

// Input options to configure backtest date range
startDate = input.int(title='Start Date', defval=1, minval=1, maxval=31)
startMonth = input.int(title='Start Month', defval=1, minval=1, maxval=12)
startYear = input.int(title='Start Year', defval=2016, minval=1800, maxval=2100)
avgVol = input.int(title="Avg Volume length", defval=20)
srcInput = input.source(close, "Source")

// Volume filter toggle
useVolumeFilter = input.bool(true, title='Enable Volume Filter')

endDate = input.int(title='End Date', defval=1, minval=1, maxval=31)
endMonth = input.int(title='End Month', defval=7, minval=1, maxval=12)
endYear = input.int(title='End Year', defval=2030, minval=1800, maxval=2100)

multiplier = input.int(title='SuperTrend Mult', defval=2, minval=1, maxval=12)
stlen = input.int(title='SuperTrend Length', defval=10, minval=1, maxval=12)

length = input.int(21, minval=1)
exit = input.int(3, minval=1, maxval=4, title='Exit Option')  // Use Option 1 to exit using lower band; Use Option 2 to exit using basis line

lower = ta.lowest(length)
upper = ta.highest(length)
basis = math.avg(upper, lower)

// Plotting the Donchian channel
l = plot(lower, color=color.new(color.blue, 0))
u = plot(upper, color=color.new(color.blue, 0))
plot(basis, color=color.new(color.orange, 0))
fill(u, l, color=color.new(color.blue, 90))

// Check if the current bar is in the date range
inDateRange = time >= timestamp(syminfo.timezone, startYear, startMonth, startDate, 0, 0) and time < timestamp(syminfo.timezone, endYear, endMonth, endDate, 0, 0)

// Long trailing stop-loss percentage
longTrailPerc = input.float(title='Trail Long Loss (%)', minval=0.0, step=0.1, defval=3) * 0.01
longStopPrice = 0.0

longStopPrice := if strategy.position_size > 0
    stopValue = close * (1 - longTrailPerc)
    math.max(stopValue, longStopPrice[1])
else
    0

// Volume filter: 20-period moving average
volumeMA = ta.sma(volume, avgVol)

// Long entry condition: Donchian breakout + volume filter
longCondition = ta.crossover(srcInput, upper[1]) and (not useVolumeFilter or volume > volumeMA)
longsma = ta.sma(close, 200)

if inDateRange and longCondition
    strategy.entry('Long', strategy.long)

// Exit conditions
if inDateRange and exit == 1
    if ta.crossunder(close, lower[1])
        strategy.close('Long')

if inDateRange and exit == 2
    if ta.crossunder(close, basis[1])
        strategy.close('Long')

[superTrend, dir] = ta.supertrend(multiplier, stlen)
if inDateRange and exit == 3
    if ta.crossunder(close, superTrend)
        strategy.close('Long')

if inDateRange and exit == 4
    if strategy.position_size > 0
        strategy.exit(id='XL TRL STP', stop=longStopPrice)

// Short conditions (commented out for now)
shortCondition = ta.crossunder(close, lower[1])

// Exit all positions when date range ends
if not inDateRange
    strategy.close_all()

// --- Add Supertrend Indicator ---
stColor = dir == 1 ? color.red : color.green
plot(superTrend, color=stColor, title="SuperTrend", linewidth=2)