다중 시간대 볼륨 및 추세 집계 거래 전략

FRVP AVWAP EMA RSI ADX MACD SMA ATR
생성 날짜: 2025-04-02 16:15:52 마지막으로 수정됨: 2025-04-02 16:15:52
복사: 0 클릭수: 375
avatar of ianzeng123 ianzeng123
2
집중하다
319
수행원

다중 시간대 볼륨 및 추세 집계 거래 전략 다중 시간대 볼륨 및 추세 집계 거래 전략

개요

이것은 복잡한 다중 지표 거래 전략으로, 거래량 중화 평균 가격 (AVWAP), 고정 범위 거래량 분산 (FRVP), 지수 이동 평균 (EMA), 상대 강도 지수 (RSI), 평균 방향 지수 (ADX) 및 이동 평균 종식 분산 (MACD) 과 같은 여러 기술 분석 도구를 결합하여 지표 집합을 통해 높은 확률의 거래 기회를 식별하기 위해 고안되었습니다.

전략 원칙

이 전략은 여러 가지 조건으로 진입 신호를 결정합니다.

  1. 가격과 AVWAP의 교차
  2. 가격 대 EMA의 위치
  3. RSI의 강도 판단
  4. MACD 트렌드 동력
  5. ADX 트렌드 강도 확인
  6. 수량 필터

전략은 아시아, 런던, 뉴욕 거래 시간대에 초점을 맞추고 있으며, 이러한 시간대는 일반적으로 유동성이 좋으며 거래 신호가 더 신뢰할 수 있습니다. 입시 논리는 긴 포지션과 빈 포지션 두 가지 모드를 포함하며,梯度止 및 중단 메커니즘을 설정합니다.

전략적 이점

  1. 다중 지표 조합, 신호 정확성 향상
  2. 동적 거래량 필터링, 낮은 유동성 거래를 피하기
  3. 유연한 스톱스트로드 전략
  4. 다른 거래 시점에 따른 전략 최적화
  5. 동적 위험 관리 장치
  6. 시각적 신호가 의사결정을 돕습니다.

전략적 위험

  1. 다중 지표 조합은 신호 복잡성을 증가시킬 수 있습니다.
  2. 데이터 재조합의 위험
  3. 다양한 시장 조건에서 성능이 불안정할 수 있다
  4. 거래 비용과 슬라이드 포인트는 실제 수익에 영향을 미칠 수 있습니다.

전략 최적화 방향

  1. 기계 학습 알고리즘의 동적 조정 파라미터를 도입
  2. 더 많은 거래 시간적 적응력을 추가합니다.
  3. 정지 손실 전략의 최적화
  4. 더 많은 필터링 조건을 도입합니다.
  5. 종자 간 통용성 전략 모델 개발

요약하다

이것은 고도로 사용자 정의되고 다차원적인 거래 전략으로, 여러 기술적 지표와 거래 시간 특성을 통합하여 거래 신호의 품질과 정확성을 높이기 위해 시도합니다. 이 전략은 수량 거래에서 지표 집약과 동적 위험 관리의 복잡성을 보여줍니다.

전략 소스 코드
/*backtest
start: 2024-04-02 00:00:00
end: 2024-12-31 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"DOGE_USDT"}]
*/

//@version=6
strategy("FRVP + AVWAP by Grok", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=100)

// User Inputs
frvpLength = input.int(20, title="FRVP Length", minval=1)
emaLength = input.int(75, title="EMA Length", minval=1) // Adjusted for stronger trend confirmation
rsiLength = input.int(14, title="RSI Length", minval=1)
adxThreshold = input.int(20, title="ADX Strength Threshold", minval=0, maxval=100)
volumeMultiplier = input.float(1.0, title="Volume Multiplier", minval=0.1)

// Stop Loss & Take Profit for XAUUSD
stopLossPips = 25 // 25 pips SL for Asian, London, NY Sessions
takeProfit1Pips = 35 // TP1 at 35 pips
takeProfit2Pips = 80 // Final TP at 80 pips

// Stop-Loss & Take-Profit Multipliers (XAUUSD: 1 pip = 0.1 points on most platforms)
stopMultiplier = float(stopLossPips) * 0.1
tp1Multiplier = float(takeProfit1Pips) * 0.1
tp2Multiplier = float(takeProfit2Pips) * 0.1

// Indicators
avwap = ta.vwap(close)  // Volume Weighted Average Price (VWAP)
ema = ta.ema(close, emaLength)     // Exponential Moving Average
rsi = ta.rsi(close, rsiLength)     // Relative Strength Index
macdLine = ta.ema(close, 12) - ta.ema(close, 26)  // MACD Line
signalLine = ta.ema(macdLine, 9)   // MACD Signal Line
atr = ta.atr(14)                   // Average True Range

// Average Directional Index (ADX)
adxSmoothing = 14
[diplus, diminus, adx] = ta.dmi(14, adxSmoothing)  // Corrected syntax for ta.dmi()

// Volume Profile (FRVP - Fixed Range Volume Profile Midpoint)
highestHigh = ta.highest(high, frvpLength)
lowestLow = ta.lowest(low, frvpLength)
frvpMid = (highestHigh + lowestLow) / 2  // Midpoint of the range

// Detect Trading Sessions
currentHour = hour(time, "UTC")  // Renamed to avoid shadowing built-in 'hour'
isAsianSession = currentHour >= 0 and currentHour < 8
isLondonSession = currentHour >= 8 and currentHour < 16
isNYSession = currentHour >= 16 and currentHour < 23

// Entry Conditions
longCondition = ta.crossover(close, avwap) and close > ema and rsi > 30 and macdLine > signalLine and adx > adxThreshold
shortCondition = ta.crossunder(close, avwap) and close < ema and rsi < 70 and macdLine < signalLine and adx > adxThreshold

// Volume Filter
avgVolume = ta.sma(volume, 20)     // 20-period Simple Moving Average of volume
volumeFilter = volume > avgVolume * volumeMultiplier  // Trade only when volume exceeds its moving average

// Trade Execution with SL/TP for Sessions
if (longCondition and volumeFilter and (isAsianSession or isLondonSession or isNYSession))
    strategy.entry("LongEntry", strategy.long, qty=100)
    strategy.exit("LongTP1", from_entry="LongEntry", limit=close + tp1Multiplier)
    strategy.exit("LongExit", from_entry="LongEntry", stop=close - stopMultiplier, limit=close + tp2Multiplier)

if (shortCondition and volumeFilter and (isAsianSession or isLondonSession or isNYSession))
    strategy.entry("ShortEntry", strategy.short, qty=100)
    strategy.exit("ShortTP1", from_entry="ShortEntry", limit=close - tp1Multiplier)
    strategy.exit("ShortExit", from_entry="ShortEntry", stop=close + stopMultiplier, limit=close - tp2Multiplier)

// Plotting for Debugging and Visualization
plot(avwap, "AVWAP", color=color.purple, style=plot.style_line, offset=0)
plot(ema, "EMA", color=color.orange, style=plot.style_line, offset=0)
// plot(rsi, "RSI", color=color.yellow, style=plot.style_histogram, offset=0)  // Better in a separate pane
// plot(macdLine, "MACD Line", color=color.blue, style=plot.style_histogram, offset=0)  // Better in a separate pane
// plot(signalLine, "Signal Line", color=color.red, style=plot.style_histogram, offset=0)  // Better in a separate pane
plot(adx, "ADX", color=color.green, style=plot.style_line, offset=0)

// Optional: Plot entry/exit signals for visualization
plotshape(longCondition and volumeFilter ? close : na, title="Long Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.tiny)
plotshape(shortCondition and volumeFilter ? close : na, title="Short Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.tiny)