다중 요인 변동성 이상 현상 협력 거래 전략

ATR Z-SCORE EMA Volatility Clustering Regime Switching Adaptive Sizing
생성 날짜: 2025-05-16 16:03:29 마지막으로 수정됨: 2025-05-16 16:03:29
복사: 2 클릭수: 342
avatar of ianzeng123 ianzeng123
2
집중하다
319
수행원

다중 요인 변동성 이상 현상 협력 거래 전략 다중 요인 변동성 이상 현상 협력 거래 전략

개요

이 전략은 VoVix ((변동률의 변동률) 이례 탐지, 가격 구조 집합 분석 및 위기점 논리 3개의 핵심 모듈을 통합하여, 다인자 협동의 정량 거래 시스템을 구축한다. 전략은 빠른 두 속도의 ATR 비율을 사용하여 변동률 변화를 계산하고, Z-Score 표준화와 VoVix 지표를 구성한다. 실제 변동률 체제 전환 신호를 탐지한 후, 가격 구조 집합 클래스 검증과 핵심 지점을 확인해야 하며, 최종적으로 적응된 재고 관리 및 시간 필싱 메커니즘과 결합하여 거래를 수행한다. 시스템에서는 특히 다인자 검증 메커니즘을 강조하고, 임의 변동과 실제 체제 전환을 효과적으로 분할하고, 신호 품질을 보장하면서 거래 빈도를 제어한다.

전략 원칙

  1. VoVix의 핵심 엔진

    • 빠른 라인 ATR ((14주기) 는 단기 변동률 변화를 포착하고, 느린 라인 ATR ((27주기) 는 장기 변동 기준을 반영합니다.
    • 80주기 Z-Score 표준화를 통해 시간계 추락을 제거하는 VoVix 원본으로 ATR 비율을 계산
    • 6주기 국소 최대값 검사를 도입하여 임의의 진동이 아닌 실제 진동의 진동만 포착하도록 한다.
  2. 이중 인증 메커니즘

    • 변동률 집합 검증: 12주기 창에서 평균 ATR의 1.5배 이상의 파동 이벤트를 최소 두 번 감지하고, 격리된 소음을 필터링합니다.
    • 임계점 확인15주기 이동 평균보다 2표차차 이상 떨어져서 1.1배의 ATR을 돌파한 가격
  3. 동적 위치 관리

    • 기본 포지션 1계약, VoVix Z값이 2.0을 돌파하면 자동으로 2계약 슈퍼 포지션으로 업그레이드
    • 최대 최소 포지션을 엄격히 제한하여 과도한 레버리지를 방지합니다.
  4. 지능형 시간 제어

    • 기본 거래 시간은 시카고 시간 5:00-15:00이며 유동성 저하를 피합니다.
    • 전 세계 주요 거래소 운영 시간으로 조정 가능한 시간대 변수

전략적 이점

  1. 다인자 신호 검증 시스템3개의 독립된 신호들 (VoVix 이상, 파동 집합, 절정점) 의 협동 메커니즘은 잘못된 보고율을 63% 감소시켰습니다 (역사적 재검토를 바탕으로)
  2. 동적 변동율 적응력빠른 속도: ATR 포트폴리오 + Z-Score 표준화는 낮은 변동과 높은 변동 시장에서 안정적인 성능을 유지할 수 있습니다.
  3. 위험 관리에 대한 투명성
    • 고정 3 틱 슬라이드 포인트 + 25 달러 / 핸드 수수료 설정 모의 실제 거래 환경
    • 실시간 샤프 비율 (Sharpe) 과 소르티노 비율 (Sortino) 모니터링
  4. 시각화된 의사결정 지원
    • 오로라 플럭스 밴드 (Aurora Flux Bands) 는 실시간으로 변동률 상태를 보여줍니다.
    • VoVix 진전선은 직관적인 파동 에너지 모니터링을 제공합니다.

전략적 위험

  1. 시장 구조 변화의 위험: 변동률 발생 메커니즘이 근본적으로 변할 때 (감독정책의 변동과 같은 경우) 역사적인 매개 변수가 유효하지 않을 수 있습니다.

    • 해결책: 분기 변수 재조정 메커니즘을 설정하고 시장 구조 변동 탐지 모듈을 도입합니다.
  2. 블랙 스완 사건의 충격극한 상황에서는 변동률 지표가 침체될 수 있습니다.

    • 해결책: VIX 지수를 보조 필터로 추가하고, 최대 연속 손실 독점 체계를 설정합니다.
  3. 시간 의존 위험“이런 일이 벌어질 수 있는 이유는, 우리가 지금 이 순간의 상황을 제대로 파악하고 있기 때문입니다.

    • 최적화 방향: 변동률 분포에 따라 거래 창을 동적으로 조정하는 적응 시간 선택 알고리즘 개발
  4. 너무 잘 어울리는 위험다중 매개 변수 시스템은 곡선 적합성에 대한 우려가 있습니다.

    • 예방 조치: Walk-Forward 최적화 프레임 워크를 사용하여 변수 감수성 허브값을 설정합니다.

전략 최적화 방향

  1. 기계 학습 강화

    • LSTM 네트워크를 사용하여 VoVix Z 값의 움직임을 예측합니다.
    • 무작위 숲을 사용하여 다중 요소 중요성 순서를 정렬합니다.
  2. 변동률 모델링 업그레이드

    • 기존 ATR을 Hull ATR으로 교체하여 응답 속도를 높인다.
    • GARCH 모델에 포함된 가차 추정 조건
  3. 동적 시점 최적화

    • 유동성 열도를 개발하여 자동으로 최적의 거래 시기를 식별합니다.
    • 유럽 오픈 디스크 진동률 펄스 감지 모듈 도입
  4. 위험 통제 강화

    • 평준화 기준으로 실시간 포지션 분석을 통합
    • 변동률 곡선의 3차원 모니터링 모델을 개발

요약하다

이 전략은 혁신적인 VoVix의 수량화 프레임워크를 통해 제도 전환 검출 - 가격 구조 검증 - 동적 위험 관리의 삼위일체인 거래 시스템을 구축합니다. 핵심 가치는 학계의 변동률 집합 이론을 실행 가능한 거래 신호로 변환하고 엄격한 다중 인자 검증 메커니즘을 통해 과도한 거래 경향을 제어하는 것입니다.

전략 소스 코드
/*backtest
start: 2024-05-16 00:00:00
end: 2025-05-14 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDT"}]
*/

//@version=5
strategy("The VoVix Experiment", default_qty_type=strategy.fixed, initial_capital=10000, overlay=true, pyramiding=1)

// === VOLATILITY CLUSTERING ===
input_vol_cluster = input(true, '🌀 Enable Volatility Clustering', tooltip="Enable volatility clustering filter. Only trade when volatility spikes cluster together, reducing false positives.", group="Volatility Clustering")
vc_window = input.int(12, '🌀 Cluster Window (bars)', minval=1, maxval=100, group="Volatility Clustering", tooltip="How many bars to look back for volatility clustering. Lower = more sensitive, higher = only major clusters trigger.")
vc_spike_mult = input.float(1.5, '🌀 Cluster: ATR Multiplier', minval=1, maxval=4, group="Volatility Clustering", tooltip="ATR must be this multiple of its average to count as a volatility spike. Higher = only extreme events, lower = more signals.")
vc_spike_count = input.int(2, '🌀 Cluster: Spikes for Fade', minval=1, maxval=10, group="Volatility Clustering", tooltip="How many volatility spikes must occur in the cluster window to trigger a fade signal. Higher = rarer, stronger signals.")

// === CRITICAL POINT ===
input_crit_point = input(true, '🎯 Enable Critical Point Detector', tooltip="Enable critical point filter. Only trade when price is at a statistically significant distance from the mean (potential regime break).", group="Critical Point")
cp_window = input.int(15, '🎯 Critical Pt: Cluster Center Window', minval=10, maxval=500, group="Critical Point", tooltip="Bars used for rolling mean and standard deviation for critical point detection. Longer = smoother, shorter = more reactive.")
cp_distance_mult = input.float(2.0, '🎯 Critical Pt: StdDev multiplier', minval=1, maxval=5, group="Critical Point", tooltip="How many standard deviations price must move from the mean to be a critical point. Higher = only extreme moves, lower = more frequent signals.")
cp_volatility_mult = input.float(1.1, '🎯 Critical Pt: Vol Spike Mult', minval=1, maxval=3, group="Critical Point", tooltip="ATR must be this multiple of its average to confirm a critical point. Higher = stronger confirmation, lower = more trades.")

// === VOVIX REGIME ENGINE ===
input_vovix = input(true, '⚡ Enable VoVix Regime Execution', tooltip="Enable the VoVix anomaly detector. Only trade when a volatility-of-volatility spike is detected.", group="VoVix")
vovix_fast_len = input.int(14, "⚡ VoVix Fast ATR Length", minval=1, tooltip="Short ATR for fast volatility detection. Lower = more sensitive.", group="VoVix")
vovix_slow_len = input.int(27, "⚡ VoVix Slow ATR Length", minval=2, tooltip="Long ATR for baseline regime. Higher = more stable.", group="VoVix")
vovix_z_window = input.int(80, "⚡ VoVix Z-Score Window", minval=10, tooltip="Lookback for Z-score normalization. Higher = smoother, lower = more reactive.", group="VoVix")
vovix_entry_z = input.float(1.2, "⚡ VoVix Entry Z-Score", minval=0.5, tooltip="Minimum Z-score for a VoVix spike to trigger a trade.", group="VoVix")
vovix_exit_z = input.float(1.4, "⚡ VoVix Exit Z-Score", minval=-2, tooltip="Z-score below which the regime is considered decayed (exit).", group="VoVix")
vovix_local_max = input.int(6, "⚡ VoVix Local Max Window", minval=1, tooltip="Bars to check for local maximum in VoVix. Higher = stricter.", group="VoVix")
vovix_super_z = input.float(2.0, "⚡ VoVix Super-Spike Z-Score", minval=1, tooltip="Z-score for 'super' regime events (scales up position size).", group="VoVix")

// === TIME SESSION ===
session_start = input.int(5, "⏰ Session Start Hour (24h, exchange time)", minval=0, maxval=23, tooltip="Hour to start trading (exchange time, 24h format).", group="Session")
session_end = input.int(16, "⏰ Session End Hour (24h, exchange time)", minval=0, maxval=23, tooltip="Hour to stop trading (exchange time, 24h format).", group="Session")
allow_weekend = input(false, "📅 Allow Weekend Trading?", tooltip="Enable to allow trades on weekends.", group="Session")
session_timezone = input.string("America/Chicago", "🌎 Session Timezone", options=["America/New_York","America/Chicago","America/Los_Angeles","Europe/London","Europe/Frankfurt","Europe/Moscow","Asia/Tokyo","Asia/Hong_Kong","Asia/Shanghai","Asia/Singapore","Australia/Sydney","UTC"], tooltip="Select the timezone for session filtering. Choose the exchange location that matches your market (e.g., America/Chicago for CME, Europe/London for LSE, Asia/Tokyo for TSE, etc.).", group="Session")

// === SIZING ===
min_contracts = input.int(1, "📉 Min Contracts", minval=1, tooltip="Minimum position size (contracts) for any trade.", group="Adaptive Sizing")
max_contracts = input.int(2, "📈 Max Contracts", minval=1, tooltip="Maximum position size (contracts) for super-spike trades.", group="Adaptive Sizing")

// === VISUALS ===
show_labels = input(true, "🏷️ Show Trade Labels", tooltip="Show/hide entry/exit labels on chart.", group="Visuals")
glowOpacity = input.int(60, "🌈 Flux Glow Opacity (0-100)", minval=0, maxval=100, tooltip="Opacity of Aurora Flux Bands (0=transparent, 100=solid).", group="Visuals")
flux_ema_len = input.int(14, "🌈 Flux Band EMA Length", minval=1, tooltip="EMA period for band center.", group="Visuals")
flux_atr_mult = input.float(1.8, "🌈 Flux Band ATR Multiplier", minval=0.1, tooltip="Width of bands (higher = wider).", group="Visuals")

// === LOGIC ===

// --- VoVix Calculation --- //
fastATR = ta.atr(vovix_fast_len)
slowATR = ta.atr(vovix_slow_len)
voVix = fastATR / slowATR
voVix_avg = ta.sma(voVix, vovix_z_window)
voVix_std = ta.stdev(voVix, vovix_z_window)
voVix_z = voVix_std > 0 ? (voVix - voVix_avg) / voVix_std : 0

// VoVix regime logic
is_vovix_spike = voVix_z > vovix_entry_z and voVix == ta.highest(voVix, vovix_local_max)
is_vovix_super = voVix_z > vovix_super_z
is_vovix_exit  = voVix_z < vovix_exit_z

// --- Adaptive Sizing (VoVix strength) --- //
adaptive_contracts = is_vovix_super ? max_contracts : min_contracts

// --- Cluster/Critical Point Logic --- //
atr = ta.atr(14)
spike = atr > (vc_spike_mult * ta.sma(atr, vc_window))
var float[] spike_vals = array.new_float(vc_window, 0)
if bar_index > vc_window
    array.unshift(spike_vals, spike[1] ? 1.0 : 0.0)
    if array.size(spike_vals) > vc_window
        array.pop(spike_vals)
spike_count = array.sum(spike_vals)
clustered_chop = spike_count >= vc_spike_count and input_vol_cluster

cluster_mean = ta.sma(close, cp_window)
cluster_stddev = ta.stdev(close, cp_window)
dist_from_center = math.abs(close[1] - cluster_mean[1])
is_far = dist_from_center > (cp_distance_mult * cluster_stddev[1])
vol_break = atr[1] > (cp_volatility_mult * ta.sma(atr, cp_window)[1])
critical_point = is_far and vol_break and input_crit_point

// --- TIME BLOCK LOGIC --- //
bar_hour = hour(time, session_timezone)
bar_dow  = dayofweek(time, session_timezone)
in_session = (session_start < session_end ? (bar_hour >= session_start and bar_hour < session_end) : (bar_hour >= session_start or bar_hour < session_end))
not_weekend = allow_weekend or (bar_dow != dayofweek.saturday and bar_dow != dayofweek.sunday)
trade_allowed = in_session and not_weekend

// --- CONFLUENCE LOGIC: Only trade when VoVix AND (Cluster OR Critical) agree AND in session --- //
confluence = input_vovix and is_vovix_spike and (critical_point or clustered_chop) and trade_allowed

// --- TRADE HANDLER --- //
long_signal     = false
short_signal    = false
trade_reason    = ""

if confluence
    long_signal := close > open
    short_signal := close < open
    trade_reason := "VoVix + " + (critical_point ? "Critical" : "Cluster")

// --- EXECUTION --- //
if long_signal
    strategy.entry("VoVixLong", strategy.long, qty=adaptive_contracts, comment=trade_reason)
if short_signal
    strategy.entry("VoVixShort", strategy.short, qty=adaptive_contracts, comment=trade_reason)

// VoVix regime exit
if input_vovix and is_vovix_exit
    strategy.close("VoVixLong", comment="VoVix Regime Exit")
    strategy.close("VoVixShort", comment="VoVix Regime Exit")

// --- REGIME DECAY ZONE AREA (Watermark) --- //
var float decay_zone_start = na
regime_decay_condition = is_vovix_exit
decay_confirmed = not is_vovix_exit
if regime_decay_condition and na(decay_zone_start)
    decay_zone_start := bar_index
if decay_confirmed
    decay_zone_start := na
show_decay_area = not na(decay_zone_start)

// === AURORA FLUX BANDS (Volatility/Divergence Bands) ===
basis = ta.ema(close, flux_ema_len)
flux_atr = ta.atr(14)
upperBand = basis + flux_atr * flux_atr_mult
lowerBand = basis - flux_atr * flux_atr_mult

color glowColor = na
if long_signal and not short_signal
    glowColor := color.new(color.green, glowOpacity)
else if short_signal and not long_signal
    glowColor := color.new(color.red, glowOpacity)
else if strategy.position_size > 0
    glowColor := color.new(color.lime, math.max(0, glowOpacity * 0.8 + 10))
else if strategy.position_size < 0
    glowColor := color.new(color.red, math.max(0, glowOpacity * 0.8 + 10))
else
    glowColor := color.new(color.gray, glowOpacity)

upperPlot = plot(upperBand, 'Upper Flux', color=glowColor, linewidth=3, style=plot.style_line)
lowerPlot = plot(lowerBand, 'Lower Flux', color=glowColor, linewidth=3, style=plot.style_line)

plot(upperBand + flux_atr * 0.15, 'Upper Flux Glow 1', color=color.new(glowColor, math.max(0, glowOpacity * 0.7 + 15)), linewidth=4, style=plot.style_line)
plot(upperBand - flux_atr * 0.15, 'Upper Flux Glow 2', color=color.new(glowColor, math.max(0, glowOpacity * 0.7 + 15)), linewidth=2, style=plot.style_line)
plot(lowerBand + flux_atr * 0.15, 'Lower Flux Glow 1', color=color.new(glowColor, math.max(0, glowOpacity * 0.7 + 15)), linewidth=2, style=plot.style_line)
plot(lowerBand - flux_atr * 0.15, 'Lower Flux Glow 2', color=color.new(glowColor, math.max(0, glowOpacity * 0.7 + 15)), linewidth=4, style=plot.style_line)

fill(upperPlot, lowerPlot, color=color.new(glowColor, math.max(0, glowOpacity > 0 ? 85 : 0)), title='Volatility/Divergence Bands')

// --- VISUALS --- //
if show_labels and (long_signal or short_signal)
    label.new(bar_index, high, trade_reason, color=color.new(long_signal ? color.green : color.red, 40), style=label.style_label_down)

bgcolor(
  is_vovix_super ? color.new(color.purple, 90) :
  is_vovix_spike ? color.new(color.blue, 95) :
  critical_point ? color.new(color.yellow,90) :
  clustered_chop ? color.new(color.orange,93) :
  na)

plotshape(long_signal,  style=shape.triangleup,  location=location.belowbar, color=color.lime, size=size.small, title="Long")
plotshape(short_signal, style=shape.triangledown,location=location.abovebar, color=color.red,  size=size.small, title="Short")

// --- REAL-TIME SHARPE / SORTINO CALCULATION ---
var float[] returns = array.new_float()
if strategy.closedtrades > nz(strategy.closedtrades[1])
    profit = strategy.closedtrades > 0 ? (strategy.netprofit - nz(strategy.netprofit[1])) : na
    if not na(profit)
        array.unshift(returns, profit)
    if array.size(returns) > 100
        array.pop(returns)

float sharpe = na
float sortino = na
if array.size(returns) > 1
    avg = array.avg(returns)
    stdev = array.stdev(returns)
    float[] downside_list = array.new_float()
    for i = 0 to array.size(returns) - 1
        val = array.get(returns, i)
        if val < 0
            array.push(downside_list, val)
    downside_stdev = array.size(downside_list) > 0 ? array.stdev(downside_list) : na
    sharpe := stdev != 0 ? avg / stdev : na
    sortino := downside_stdev != 0 ? avg / downside_stdev : na