동적 공급 및 수요 범위 중간선 역전 전략

SMA TP SL SUPPLY ZONE DEMAND ZONE Midline Rejection
생성 날짜: 2025-02-24 09:54:03 마지막으로 수정됨: 2025-02-24 16:00:34
복사: 2 클릭수: 353
avatar of ianzeng123 ianzeng123
2
집중하다
319
수행원

동적 공급 및 수요 범위 중간선 역전 전략 동적 공급 및 수요 범위 중간선 역전 전략

개요

이 전략은 공급과 수요의 범위와 중선 반전 기반의 거래 시스템으로, 5분 시간 프레임에 작동한다. 트렌드가 중선 위치로 회전될 때 반전 신호를 식별하여 거래하고, 미리 결정된 공급과 수요의 영역에 스톱 스로프를 설정한다. 전략은 이동 평균 ((SMA) 을 결합하여 공급과 수요의 범위를 식별하여, 중간 지점을 중요한 가격 참조 수준으로 사용하여 트렌드 방향을 결정한다.

전략 원칙

전략의 핵심 논리에는 다음과 같은 핵심 요소가 포함됩니다.

  1. 공급 요구 영역의 결정: 사용자 사용자 정의 사이클을 사용하여 최고 가격과 최저 가격을 결정하기 위해 공급 영역 (저항 지점) 과 수요 영역 (지원 지점)
  2. 중간선 계산: 물가 반전의 중요한 기준점으로 공급과 수요의 중간 지점을 취한다.
  3. 트렌드 판단: 간단한 이동 평균을 사용하여 현재 트렌드 방향을 판단합니다.
  4. 입장 조건:
    • 다면: 가격이 평균선 위에 있다 (상승 추세), 그리고 중간 지점 아래에서 시세 형태가 나타난다.
    • 공백점: 가격이 평균선 아래로 ((하향 추세) 로, 중점 위에는 하향상태가 나타납니다.
  5. 정지 손해 설정:
    • 다중 헤드: 공급 구역에 설치된 중지, 수요 구역에 설치된 중지
    • 빈 머리: 정지는 수요 영역에, 손실은 공급 영역에 설정

전략적 이점

  1. 명확한 논리: 트렌드, 가격 구조 및 그래프 형태를 결합하여 완전한 거래 시스템을 구축합니다.
  2. 리스크 관리: 시장 구조에 따라 설정된 스톱 스톱 손실, 가격 운동 법칙에 따라
  3. 적응력: 다양한 시장 환경에 따라 변수를 조정할 수 있습니다.
  4. 시각화 지원: 표시 및 라인을 통해 거래 신호 및 핵심 가격을 직관적으로 표시
  5. 높은 수준의 자동화: 입출장 조건이 명확하고 완전히 자동화된 거래가 가능합니다.

전략적 위험

  1. 가짜 돌파 위험: 물가가 수요와 공급의 범위 내에서 흔들리고, 가짜 신호를 생성할 수 있다.
  2. 매개 변수 민감성: 다른 매개 변수 설정으로 인해 거래 결과가 크게 달라질 수 있습니다.
  3. 시장 환경 의존성: 급격한 변동이나 수평 시장에서 부진할 수 있다.
  4. 슬라이드 포인트 효과: 유동성이 낮은 시장에서 실제 거래 가격은 신호 가격과 큰 편차가 있을 수 있다.
  5. 과도한 거래: 빈번한 간격 돌파가 과도한 거래로 이어질 수 있다.

전략 최적화 방향

  1. 신호 필터:
    • 수량확인 추가
    • 변동률 지표 필터링 거래 환경을 도입
  2. 동적 변수:
    • 시장의 변동성에 따른 적응 변수
    • 적응형 이동 평균을 도입합니다.
  3. 위험 관리 최적화:
    • 동적 위치관리 실현
    • 필터에 손실을 추가
  4. 시장환경 인식:
    • 시장 상태 분류 시스템을 개발
    • 다른 시장 상태에서 다른 매개 변수 설정을 사용

요약하다

동적 공급 수요 간 중선 역전 전략은 기술 분석의 여러 차원을 결합한 거래 시스템으로, 공급 수요 간, 트렌드 및 가격 형태의 조합을 통해 시장 기회를 포착한다. 이 전략의 핵심 장점은 명확한 논리 프레임 워크와 완벽한 위험 관리 시스템이지만, 동시에 거래자가 시장 환경의 변화에 주의 깊게 관찰하고 매개 변수 설정을 적시에 조정해야 한다. 제안된 최적화 방향으로 전략의 안정성과 적응성이 더욱 향상될 전망이다.

전략 소스 코드
/*backtest
start: 2025-02-16 00:00:00
end: 2025-02-23 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Binance","currency":"SOL_USDT"}]
*/

// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © bommytarton

//@version=6
strategy("Midline Rejection Entry with TP/SL at Supply/Demand", overlay=true)

// User inputs for Swing Length and Length for Supply/Demand Zones
length = input.int(50, title="Swing Length", minval=1)
midlineLength = input.int(20, title="Midline Length for Trend", minval=1)  // Moving average length for trend

// Identify swing highs (Supply Zone) and swing lows (Demand Zone)
supplyZone = ta.highest(high, length) // Supply Zone (resistance)
demandZone = ta.lowest(low, length) // Demand Zone (support)

// Calculate the midpoint between supply and demand zones
midpoint = (supplyZone + demandZone) / 2

// Trend Detection: Use a simple moving average (SMA) for trend direction
smaTrend = ta.sma(close, midlineLength)

// Variables to store Supply/Demand Zones at the time of entry
var float entrySupplyZone = na
var float entryDemandZone = na
var float entryMidpoint = na

// Entry Conditions
// 1. Price in an uptrend (close above SMA)
longCondition = close > smaTrend and close < midpoint and close > open and open < close[1] and close[1] < open[1]

// 1. Price in a downtrend (close below SMA)
shortCondition = close < smaTrend and close > midpoint and close < open and open > close[1] and close[1] > open[1]

// Close any open trades before opening a new one
if (longCondition or shortCondition)
    strategy.close_all()

// Execute the entry logic
if (longCondition)
    entrySupplyZone := supplyZone  // Store Supply Zone for Take Profit
    entryDemandZone := demandZone  // Store Demand Zone for Stop Loss
    entryMidpoint := midpoint      // Store Midpoint
    strategy.entry("Long", strategy.long)
    label.new(bar_index, low, "Open Long", color=color.green, textcolor=color.white, style=label.style_label_up, size=size.small)

if (shortCondition)
    entrySupplyZone := supplyZone  // Store Supply Zone for Stop Loss
    entryDemandZone := demandZone  // Store Demand Zone for Take Profit
    entryMidpoint := midpoint      // Store Midpoint
    strategy.entry("Short", strategy.short)
    label.new(bar_index, high, "Open Short", color=color.red, textcolor=color.white, style=label.style_label_down, size=size.small)

// Define Take Profit and Stop Loss Levels for Long/Short Trades
if (strategy.opentrades > 0)
    // For Long trades, use Supply Zone for Take Profit and Demand Zone for Stop Loss
    if (strategy.position_size > 0)
        strategy.exit("Take Profit", "Long", limit=entrySupplyZone)  // Take Profit at Supply Zone
        strategy.exit("Stop Loss", "Long", stop=entryDemandZone)    // Stop Loss at Demand Zone


    // For Short trades, use Demand Zone for Take Profit and Supply Zone for Stop Loss
    if (strategy.position_size < 0)
        strategy.exit("Take Profit", "Short", limit=entryDemandZone)  // Take Profit at Demand Zone
        strategy.exit("Stop Loss", "Short", stop=entrySupplyZone)     // Stop Loss at Supply Zone


// Re-Plot Supply, Midpoint, and Demand Zones after Trade Closure
plot(supplyZone, title="Supply Zone", color=color.red, linewidth=2, style=plot.style_line)
plot(demandZone, title="Demand Zone", color=color.green, linewidth=2, style=plot.style_line)
plot(midpoint, title="Midpoint", color=color.blue, linewidth=1, style=plot.style_line)