VWAP 변동성 반전 전략 표준편차 채널의 롱 앤 숏 브레이크아웃 시스템

VWAP SD SMA ATR RSI
생성 날짜: 2025-02-20 09:33:31 마지막으로 수정됨: 2025-02-20 09:33:31
복사: 1 클릭수: 469
avatar of ianzeng123 ianzeng123
2
집중하다
319
수행원

VWAP 변동성 반전 전략 표준편차 채널의 롱 앤 숏 브레이크아웃 시스템 VWAP 변동성 반전 전략 표준편차 채널의 롱 앤 숏 브레이크아웃 시스템

개요

이 전략은 VWAP (거래량 가중 평균 가격) 과 표준 차차 통로를 기반으로 한 거래 시스템으로, 통로 경계에서 가격의 역전 형태를 식별하여 거래합니다. 이 전략은 동력과 평균값 회귀의 거래 개념을 결합하여 가격이 중요한 기술 지점을 돌파 할 때 거래 기회를 포착합니다.

전략 원칙

전략의 핵심은 VWAP를 가격의 중심으로 20주기 표준차를 이용한 상하 통로를 구축하는 것이다. 하하철 근처에서 더 많은 기회를 찾고, 상하철 근처에서 공백 기회를 찾는다. 구체적으로:

  • 다중 조건: 가격이 하위 궤도에서 부자 역전 형태를 형성하고, 그 다음에는 이전 양선 고점을 돌파한다
  • 공백 조건: 가격이 상반기에 하향상태를 형성하고, 그 다음에는 전의 음계 하락점을 돌파한다.
  • 정지 설정: VWAP와 상철을 목표로 더 많은 작업을 수행하고 하철을 목표로 공백을 수행합니다.
  • 손해 중지 설정: 오버는 역전선 낮점으로 손해 중지, 코어는 역전선 높점으로 손해 중지

전략적 이점

  1. 트렌드 추적과 반전 거래의 장점을 결합하여, 트렌드 지속과 반전 기회를 잡을 수 있습니다.
  2. VWAP를 핵심 지표로 사용하면 시장의 실제 수요와 공급을 더 잘 반영할 수 있습니다.
  3. 다양한 가격에서 수익을 창출할 수 있는 세트 스티핑 방식
  4. 합리적인 HAL 설정으로 위험을 효과적으로 제어할 수 있습니다.
  5. 명확한 전략 논리, 간단한 변수 설정, 이해하기 쉽고 실행

전략적 위험

  1. 급격한 변동성 시장에서 자주 스톱 손실을 유발할 수 있습니다
  2. 수평 정리 단계에서는 너무 많은 가짜 신호가 발생할 수 있습니다.
  3. VWAP 계산의 시간주기에 민감하다
  4. 표준 차차 통로 폭은 모든 시장 환경에 적합하지 않을 수 있습니다.
  5. 중요한 트렌드 기회를 놓칠 수도 있습니다.

전략 최적화 방향

  1. 교통량 필터를 도입하여 신호 품질을 향상시킵니다.
  2. 이동 평균 시스템과 같은 트렌드 확인 지표를 추가합니다.
  3. 동적으로 표준 격차 주기를 조정하여 다른 시장 환경에 적응
  4. 전체 수익률을 높이기 위해 분량 정지 비율을 최적화하십시오
  5. 시간 필터를 추가하여 불리한 시간에 거래하는 것을 피하십시오.
  6. 변동률 지표를 늘리고 포지션 관리를 최적화할 수 있다.

요약하다

이것은 VWAP, 표준 격차 통로 및 가격 형태를 결합한 완전한 거래 시스템이다. 전략은 중요한 가격에서 역전 신호를 찾아 거래하고, 분기된 정지 및 합리적인 정지를 사용하여 위험을 관리한다. 제한이 있기는 하지만, 제안된 최적화 방향을 통해 전략의 안정성과 수익성을 더욱 향상시킬 수 있다. 전략은 변동성이 높은 시장의 응용에 적합하며, 중장기 거래자에게는 고려할 가치가 있는 거래 시스템이다.

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

//@version=6  
strategy("VRS Strategy", overlay=true)  

// Calculate VWAP  
vwapValue = ta.vwap(close)  

// Calculate standard deviation for the bands  
stdDev = ta.stdev(close, 20) // 20-period standard deviation for bands  
upperBand = vwapValue + stdDev  
lowerBand = vwapValue - stdDev  

// Plot VWAP and its bands  
plot(vwapValue, color=color.blue, title="VWAP", linewidth=2)  
plot(upperBand, color=color.new(color.green, 0), title="Upper Band", linewidth=2)  
plot(lowerBand, color=color.new(color.red, 0), title="Lower Band", linewidth=2)  

// Signal Conditions  
var float previousGreenCandleHigh = na  
var float previousGreenCandleLow = na  
var float previousRedCandleLow = na  

// Detect bearish candle close below lower band  
bearishCloseBelowLower = close[1] < lowerBand and close[1] < open[1]  

// Detect bullish reversal candle after a bearish close below lower band  
bullishCandle = close > open and low < lowerBand // Ensure it's near the lower band  
candleReversalCondition = bearishCloseBelowLower and bullishCandle  

if (candleReversalCondition)  
    previousGreenCandleHigh := high[1]  // Capture the high of the previous green candle  
    previousGreenCandleLow := low[1]     // Capture the low of the previous green candle  
    previousRedCandleLow := na            // Reset previous red candle low  

// Buy entry condition: next candle breaks the high of the previous green candle  
buyEntryCondition = not na(previousGreenCandleHigh) and close > previousGreenCandleHigh  

if (buyEntryCondition)  
    // Set stop loss below the previous green candle  
    stopLoss = previousGreenCandleLow   
    risk = close - stopLoss // Calculate risk for position sizing  

    // Target Levels  
    target1 = vwapValue // Target 1 is at VWAP  
    target2 = upperBand  // Target 2 is at the upper band  

    // Ensure we only enter the trade near the lower band  
    if (close < lowerBand)  
        strategy.entry("Buy", strategy.long)  
        
        // Set exit conditions based on targets  
        strategy.exit("Take Profit 1", from_entry="Buy", limit=target1)  
        strategy.exit("Take Profit 2", from_entry="Buy", limit=target2)  
        strategy.exit("Stop Loss", from_entry="Buy", stop=stopLoss)  

// Sell signal condition: Wait for a bearish candle near the upper band  
bearishCandle = close < open and high > upperBand // A bearish candle should be formed near the upper band  
sellSignalCondition = bearishCandle  

if (sellSignalCondition)  
    previousRedCandleLow := low[1] // Capture the low of the current bearish candle  

    // Sell entry condition: next candle breaks the low of the previous bearish candle  
    sellEntryCondition = not na(previousRedCandleLow) and close < previousRedCandleLow  

    if (sellEntryCondition)  
        // Set stop loss above the previous bearish candle  
        stopLossSell = previousRedCandleLow + (high[1] - previousRedCandleLow) // Set stop loss above the bearish candle  
        targetSell = lowerBand // Target for sell is at the lower band  

        // Ensure we only enter the trade near the upper band  
        if (close > upperBand)  
            strategy.entry("Sell", strategy.short)  
            
            // Set exit conditions for sell  
            strategy.exit("Take Profit Sell", from_entry="Sell", limit=targetSell)  
            strategy.exit("Stop Loss Sell", from_entry="Sell", stop=stopLossSell)  

// Reset previous values when a trade occurs  
if (strategy.position_size > 0)  
    previousGreenCandleHigh := na  
    previousGreenCandleLow := na  
    previousRedCandleLow := na