다중 트렌드 돌파 모멘텀 트레이딩 전략

EMA ATR VOLUME SMA BREAKOUT Consolidation
생성 날짜: 2025-02-20 13:14:39 마지막으로 수정됨: 2025-02-20 14:53:56
복사: 0 클릭수: 81
avatar of ianzeng123 ianzeng123
2
집중하다
37
수행원

다중 트렌드 돌파 모멘텀 트레이딩 전략 다중 트렌드 돌파 모멘텀 트레이딩 전략

개요

이 전략은 여러 지표가 결합된 트렌드 추적 시스템으로, 주로 가격 돌파구, 거래량 확인 및 평행 시스템 조합을 식별하여 시장의 트렌드 기회를 포착한다. 이 전략은 가격에 대한 최근의 고 / 낮은 돌파구, 거래량의 눈에 띄는 확대 및 다중 지수 이동 평균 (EMA) 의 배열을 모니터링하여 거래 신호를 결정한다. 이 전략은 또한 잠재적인 공백 기회를 포착하기 위해 혁신적인 좁은 범위를 정리하는 식별 메커니즘을 포함합니다.

전략 원칙

이 전략의 핵심 논리는 다음과 같은 핵심 요소에 기반합니다.

  1. 가격 돌파구 시스템: 지난 20주기의 최고/하위치에 대한 가격 돌파구를 모니터링합니다.
  2. 거래량 확인: 지난 20주기의 평균 거래량의 최소 2배 이상의 거래량을 요구합니다.
  3. 평균선 시스템: 30/50/200 주기의 EMA를 사용하여 트렌드 확인 시스템을 구축
  4. 다중 조건: 가격이 새로운 고도를 돌파하고 거래량이 증가하고, 가격이 200 EMA에 서고, 단기 평균선은 중기 평균선 위에 있고 중기 평균선은 장기 평균선 위에 있다
  5. 2개의 입학 메커니즘이 포함됩니다.
    • 전통적 폭파: 가격 폭파, 거래량이 증가, 평균선 空頭 배열 및 200 EMA 아래로 기울기
    • 좁은 정리 공백: 가격 중기 평균선 아래에서 좁은 정리, ATR의 0.5배 미만의 정리

전략적 이점

  1. 다중 확인 메커니즘: 가격 돌파구, 거래량 및 평균선 삼중 확인을 통해 신호 신뢰성을 향상
  2. 유연한 코카이 메커니즘: 2개의 독립적인 코카이 입장을 제공하여 거래 기회를 증가시킵니다.
  3. 자기 적응성: ATR을 통해 좁은 조정을 정의하여 다양한 시장 변동 환경에 적응할 수 있도록합니다.
  4. 리스크 관리가 개선: 200EMA를 스톱 레퍼런스로 사용하여 명확한 탈퇴 메커니즘을 제공합니다.
  5. 매개 변수 조정성: 핵심 매개 변수는 시장 특성에 따라 최적화 될 수 있습니다.

전략적 위험

  1. 가짜 브레이크 위험: 시장에서 가짜 브레이크가 발생할 수 있으며, 이는 잘못된 신호로 이어질 수 있습니다.
  2. 슬라이드 포인트 위험: 거래량이 급격히 증가하는 시점에 큰 슬라이드 포인트가 발생할 수 있습니다.
  3. 트렌드 리버스 위험: 강한 트렌드 시장에서, 평행선 손실을 사용하는 것은 조기 퇴출을 유발할 수 있습니다.
  4. 매개 변수 민감성: 정책 성능은 매개 변수 설정에 민감하며 신중한 최적화가 필요합니다.
  5. 시장 환경 의존성: 불안정한 시장에서 빈번하게 잘못된 신호가 발생할 수 있습니다.

전략 최적화 방향

  1. 트렌드 강도 필터를 도입합니다: 트렌드 강도 지표인 ADX를 추가하여 약한 트렌드 환경에서 신호를 필터링할 수 있습니다.
  2. 최적화된 손해 차단 메커니즘: ATR 기반의 동적 차단을 도입하여 손해 차단의 유연성을 높일 수 있습니다.
  3. 포지션 관리를 개선: 파격 강도 및 시장 변동 동력에 따라 포지션 규모를 조정
  4. 시간 필터 추가: 일간 시간 필터를 추가하여 변동성이 높은 개시 및 종료 시간에 거래하는 것을 피합니다.
  5. 시장 환경 분류를 도입합니다: 다양한 시장 환경에 따라 전략 파라미터를 동적으로 조정합니다.

요약하다

다중 트렌드 돌파량 거래 전략은 다중 기술 지표의 결합 사용으로 유연한 거래 기회를 제공하면서 신호의 신뢰성을 보장하는 통합적인 트렌드 추적 시스템입니다. 전략의 혁신은 전통적인 돌파 거래 방법과 새로운 유형의 좁은 정리 식별 장치를 결합하여 다양한 시장 환경에 적응 할 수 있습니다.

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

//@version=5
strategy("Breakout Strategy (Long & Short) + Slope of 200 EMA", overlay=true)

// -------------------
// 1. Settings
// -------------------
breakout_candles = input.int(20, title="Number of Candles for Breakout")
range_candles    = input.int(10, title="Number of Candles for Previous Range")

ema_long_period   = input.int(200, title="Long EMA Period")
ema_medium_period = input.int(50,  title="Medium EMA Period")
ema_short_period  = input.int(30,  title="Short EMA Period")

// Checkbox to allow/disallow short positions
allowShort = input.bool(true, title="Allow Short Positions")

// Inputs for the new Narrow Consolidation Short setup
consolidationBars     = input.int(10,   "Consolidation Bars",   minval=1)
narrowThreshInAtr     = input.float(0.5,"Narrowness (ATR Mult.)",minval=0.0)
atrLength             = input.int(14,   "ATR Length for Range")

// -------------------
// 2. Calculations
// -------------------
breakout_up   = close > ta.highest(high, breakout_candles)[1]
breakout_down = close < ta.lowest(low,  breakout_candles)[1]

prev_range_high = ta.highest(high, range_candles)[1]
prev_range_low  = ta.lowest(low,  range_candles)[1]

ema_long   = ta.ema(close, ema_long_period)
ema_medium = ta.ema(close, ema_medium_period)
ema_short  = ta.ema(close, ema_short_period)

average_vol      = ta.sma(volume, breakout_candles)
volume_condition = volume > 2 * average_vol

// 200 EMA sloping down?
ema_long_slope_down = ema_long < ema_long[1]

// For the Narrow Consolidation Short
rangeHigh   = ta.highest(high, consolidationBars)
rangeLow    = ta.lowest(low,  consolidationBars)
rangeSize   = rangeHigh - rangeLow

atrValue    = ta.atr(atrLength)

// Condition: Price range is "narrow" if it's less than (ATR * threshold)
narrowConsolidation = rangeSize < (atrValue * narrowThreshInAtr)

// Condition: All bars under Medium EMA if the highest difference (high - ema_medium) in last N bars is < 0
allBelowMedium = ta.highest(high - ema_medium, consolidationBars) < 0

// -------------------
// 3. Long Entry
// -------------------
breakout_candle_confirmed_long = ta.barssince(breakout_up) <= 3

long_condition = breakout_candle_confirmed_long
     and volume_condition
     and close > prev_range_high
     and close > ema_long
     and ema_short > ema_medium
     and ema_medium > ema_long
     and strategy.opentrades == 0

if long_condition
    strategy.entry("Long", strategy.long)

// -------------------
// 4. Short Entries
// -------------------

// (A) Original breakout-based short logic
breakout_candle_confirmed_short = ta.barssince(breakout_down) <= 3
short_condition_breakout = breakout_candle_confirmed_short
     and volume_condition
     and close < prev_range_low
     and close < ema_long
     and ema_short < ema_medium
     and ema_medium < ema_long
     and ema_long_slope_down
     and strategy.opentrades == 0

// (B) NEW: Narrow Consolidation Short
short_condition_consolidation = narrowConsolidation
     and allBelowMedium
     and strategy.opentrades == 0

// Combine them: if either short scenario is valid, go short
short_condition = (short_condition_breakout or short_condition_consolidation) and allowShort

if short_condition
    // Use a different order ID if you want to distinguish them
    // but "Short" is fine for a single position
    strategy.entry("Short", strategy.short)

// -------------------
// 5. Exits
// -------------------
if strategy.position_size > 0 and close < ema_long
    strategy.close("Long", qty_percent=100)

if strategy.position_size < 0 and close > ema_long
    strategy.close("Short", qty_percent=100)

// ======================================================================
// 5. ADDITIONAL PARTIAL EXITS / STOPS
// ======================================================================
// You can add partial exits for shorts or longs similarly.
// For example:
// if strategy.position_size < 0 and close > stop_level_for_short
//     strategy.close("Short", qty_percent=50)