GRIA Market Regime Monitor

GRIA Market Regime Monitor is a non-repainting, scale-invariant market regime and tail-risk indicator built for MetaTrader 5 across Forex, Metals, and Indices. Rather than relying on lagging crossovers or fixed pip thresholds that degrade as volatility cycles shift, it combines three orthogonal closed-bar quantitative sensors inside one clean subwindow and an optional live chart HUD.

Three Orthogonal Quantitative Sensors

- Bidirectional WVF / ATR Systemic Panic Sensor: Evaluates the 88-bar bidirectional Williams VIX Fix excursion from local extremes (capturing both sharp sell-offs and upside squeezes) normalized by Wilder's ATR(14). Uses pure price action with zero external symbol dependencies.
- Causal Non-Parametric Robust MAD Z-Score: Computes closed-bar logarithmic returns and compares the latest bar against the preceding 100-bar distribution using Median and Median Absolute Deviation (MAD * 1.4826). Because extreme jumps cannot distort the median baseline, fat-tail Poisson shocks are isolated cleanly and trigger an automatic post-shock quarantine cooldown.
- Kaufman Efficiency Ratio (KER) & EMA Slope: Pairs the 20-period Kaufman Efficiency Ratio with a 50-period EMA slope and net displacement check to distinguish clean laminar trends from stationary consolidation ranges.

Visual Legend & Five Regime States

- 0 - Green (Safe Equilibrium Range): KER at or below threshold with no active shock or panic. Suitable environment for mean-reversion setups.
- 1 - Dodger Blue (Bullish Laminar Trend): KER above threshold with price above EMA(50), positive EMA slope, and positive net displacement.
- 2 - Dark Orange (Bearish Laminar Trend): KER above threshold with price below EMA(50), negative EMA slope, and negative net displacement.
- 3 - Crimson (Fat-Tail Shock & Quarantine): Robust Z-Score above the 3-Sigma gate, holding protective quarantine for the configured cooldown bars.
- 4 - Magenta (Systemic WVF-ATR Panic): Bidirectional volatility excursion exceeding the configured ATR multiple limit.
- Sky Blue Line & Live HUD: Displays scaled Kaufman Efficiency (KER * 3.0) against the 1.35 dotted trend gate, plus a closed-bar HUD badge with live Spread/ATR execution friction monitoring.

Input Parameters

- InpKERPeriod (20): Lookback bars for Kaufman Efficiency Ratio calculation.
- InpKERThreshold (0.45): Minimum KER value required to classify a laminar trend.
- InpEMAPeriod (50): Directional trend EMA period in bars.
- InpMADWindow (100): Causal window size for non-parametric Median and MAD return statistics.
- InpShockZThreshold (3.0): Robust Z-Score threshold in sigma to flag a fat-tail shock.
- InpWVFPeriod (88): Lookback window in bars for bidirectional Williams VIX Fix excursion.
- InpATRPeriod (14): Wilder ATR period for scale-invariant normalization.
- InpWVFATRLimit (14.0): Systemic panic limit expressed as ATR multiples.
- InpCooldownBars (12): Number of closed bars to maintain post-shock hysteresis quarantine.
- InpMaxSpreadATR (0.60): Live Spread/ATR ratio threshold to display a high-friction warning on the HUD.
- InpShowHUD (true): Displays or hides the compact corner HUD on the main price chart.

Integration in Expert Advisors (iCustom)

Two calculation buffers expose raw, unclipped closed-bar metrics for direct EA filtering (always query shift 1 for strict closed-bar causality):
- Buffer 3: Integer regime state from 0 to 4 (0 = Safe Range, 1 = Bull Trend, 2 = Bear Trend, 3 = Shock/Quarantine, 4 = Systemic Panic).
- Buffer 4: Raw Kaufman Efficiency Ratio from 0.0 to 1.0.

Example handle initialization in MQL5:
iCustom(_Symbol, _Period, "Market\\GRIA Market Regime Monitor") followed by CopyBuffer(handle, 3, 1, 1, state_buf).
Filtrer:
Aucun avis
Répondre à l'avis