GKYZ Volatility Estimator MT5
- Indicatori
-
Anthony Cooke
Quantitative Systems Architect and C++, Python, MQL5, MQL4, and Pine Script developer specializing in non-repainting mathematical indicators, Expert Advisors, and statistical strategy audits. I combine industrial quality-control engineering and Applied Mathematics with multi-physics market modeling - Versione: 1.0
- Attivazioni: 5
OVERVIEW AND SCIENTIFIC ORIGIN
The GKYZ Volatility Estimator is an institutional range-and-gap volatility indicator engineered from Quantitative Finance and Volatility Econometrics, combining the Garman-Klass (1980) OHLC range estimator with the Yang-Zhang (2000) overnight-gap variance extension (GKYZ). Standard close-to-close standard deviation ignores everything that happens inside a candle's high-low wicks, while naive ATR mixes volatility with absolute price scale.
By incorporating Open, High, Low, Close, and prior Close into one strictly causal mathematical estimator, GKYZ achieves roughly 8x higher statistical estimation efficiency than standard close-to-close volatility. Converting raw sigma into a self-calibrating 0% to 100% Empirical Volatility Regime Percentile lets traders spot breakout squeeze coils, rising range momentum, and extreme tail-risk shocks across Gold (XAUUSD), Major Forex pairs, and US Indices from M15 to Daily charts.
MATHEMATICAL ENGINE
On every closed bar over InpPeriod (default 20 bars), the indicator computes exact causal GKYZ range-and-gap variance:
Var_GKYZ = (1 / P) * Sum[ ln(O / C_prev)^2 + 0.5 * ln(H / L)^2 - (2 * ln(2) - 1) * ln(C / O)^2 ]
It outputs raw 1-bar expected sigma (in basis points and exact chart broker points), institutional annualized volatility (252 trading-day scaling), the GK/CC ratio comparing GKYZ range volatility against close-to-close volatility, and the percentage of variance coming from overnight or session open gaps. Finally, it ranks live sigma against a causal rolling window (InpRankPeriod = 120 bars) to generate a self-calibrating 0% to 100% volatility percentile.
HOW TO READ THE VOLATILITY CYCLE (0% TO 100%)
Subwindow Scale (0.0 to 105.0, dashed thresholds at 85.0, 50.0, and 25.0):
This indicator maps the market volatility cycle from quiet compression at the bottom to extreme shock climaxes at the top (not bullish vs. bearish price direction):
- Aqua Histogram (Vol_Squeeze, 25% and below): Volatility Squeeze / Compression. Market range is coiling tightly, historically preceding sharp directional breakouts and allowing tighter tactical entries.
- SteelBlue Histogram (Vol_Normal, 25% to 75%): Balanced operating volatility suited for standard trend and pullback execution.
- Gold Histogram (Vol_Expanding, 75% to 85%): Active Volatility Expansion with accelerating directional range momentum.
- OrangeRed Bold Histogram (Vol_Extreme, 85% and above): Extreme Volatility Shock / Tail Climax where standard stops face sweep risk, position size should be reduced, and stop buffers widened.
- WhiteSmoke Smooth Line (GKYZ_Vol_Curve): 4-bar EMA structural volatility percentile trajectory.
- Magenta Dot (Vol_Shock_Alert): Hysteresis-locked volatility shock alert dot plotted on the WhiteSmoke curve when volatility first reaches 85% or higher (resets only after cooling back below the 50% midpoint to eliminate dot clusters).
DARK TELEMETRY HUD BOX GUIDE
Located in the upper-right subwindow inside a solid dark slate panel with a DodgerBlue border:
- Line 1 (GKYZ VOLATILITY): Live volatility regime (VOL SQUEEZE, NORMAL REGIME, VOL EXPANDING, or EXTREME SHOCK) and 0% to 100% percentile rank.
- Line 2 (ANN VOL and 1-BAR): Annualized GKYZ volatility percentage paired with 1-bar expected standard deviation in both basis points and exact broker points (pts) for direct stop-loss calibration and volatility-targeted lot sizing.
- Line 3 (GK/CC RATIO and GAP SHARE): Ratio of GKYZ range volatility to close-to-close volatility (illuminates Gold at or above 1.25x to flag hidden intraday wick turbulence missed by close-only indicators), plus the percentage of variance driven by open gaps.
- Line 4 (REGIME NOTE): Direct risk-management guidance (COILING FOR BREAKOUT, BALANCED VOLATILITY, ELEVATED RANGE MOMENTUM, or TAIL RISK / WIDEN STOPS).
PRACTICAL USAGE
Preparing for Breakouts (Aqua Squeeze <= 25%):
When bars drop into Aqua below 25% and HUD Line 4 reads COILING FOR BREAKOUT, range compression is mature. Watch key chart structure for the initial volatility breakout as the WhiteSmoke curve turns upward out of the squeeze.
Risk Sizing and Stop Protection (OrangeRed Shock >= 85% + Magenta Dot):
When bars surge into OrangeRed with a Magenta dot (TAIL RISK / WIDEN STOPS), read the exact 1-BAR points figure on HUD Line 2 to scale your stop distance and reduce lot size proportionally instead of relying on fixed pip stops. If Line 3 lights up Gold (GK/CC >= 1.25x), candles are printing wide hidden wicks even if closes look calm—avoid tight stops.
TECHNICAL SPECIFICATIONS AND INPUT PARAMETERS
Calculation Engine:
100 percent causal bar-by-bar indexing with zero repainting, zero backpainting, and zero external DLL calls. Short name: GKYZ_Vol(20,120).
Estimator Windows:
- InpPeriod (Default: 20): Rolling OHLC and gap variance estimation window in bars.
- InpRankPeriod (Default: 120): Rolling lookback window for the 0% to 100% Empirical Volatility Percentile.
Regime Thresholds and Display:
- InpSqueezeLevel (Default: 25.0): Upper boundary (%) for Aqua Vol_Squeeze compression troughs.
- InpExpandLevel (Default: 75.0): Lower boundary (%) for Gold Vol_Expanding range momentum.
- InpExtremeLevel (Default: 85.0): Threshold (%) for OrangeRed Vol_Extreme bars and Magenta hysteresis shock dots.
- InpShowHUD (Default: true): Toggles the 4-line dark telemetry HUD (automatically bypassed during optimization).
Expert Advisor Integration (iCustom Buffers):
Buffer 0: Vol_Squeeze | Buffer 1: Vol_Normal | Buffer 2: Vol_Expanding | Buffer 3: Vol_Extreme | Buffer 4: GKYZ_Vol_Curve | Buffer 5: Vol_Shock_Alert | Buffer 6: GKYZ_Annual_Vol (Hidden annualized %) | Buffer 7: GKYZ_Bar_Vol_Bps (Hidden 1-bar expected sigma in bps for dynamic EA stop and lot scaling).
TIMEFRAME AND ASSET CALIBRATION
Default settings (20-bar GKYZ window, 120-bar percentile rank, 25% / 75% / 85% thresholds) self-calibrate automatically across XAUUSD, Major Forex pairs, and US Indices from M15 to Daily:
- Intraday Trading (M15 to H1 on XAUUSD and US Indices): Keep InpPeriod at 14 to 20 and InpRankPeriod at 96 to 120 so the percentile captures multi-session London/New York volatility cycles cleanly.
- Swing and Daily Regimes (H4 to Daily on Major Forex): Use InpPeriod = 20 and InpRankPeriod = 120 to 200 to compare current volatility against multi-month historical regimes.
- Stricter Squeeze or Shock Isolation: Tighten InpSqueezeLevel to 15.0 to 20.0 to isolate only ultra-tight coils, or raise InpExtremeLevel to 90.0 for extreme tail-event alerts only.
----Trading on MetaTrader 4 instead of MetaTrader 5? The identically engineered MetaTrader 4 edition of GKYZ Volatility Estimator is published on my MQL5 Seller Profile with the exact same thumbnail, OHLC range-and-gap variance engine, dark telemetry HUD, and parameter set. Visit my seller profile to access the MT4 version.
