Kyle Lambda Liquidity Impact MT4
- Göstergeler
-
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 - Sürüm: 1.10
- Etkinleştirmeler: 5
OVERVIEW AND SCIENTIFIC ORIGIN
The Kyle Lambda Liquidity Impact indicator is an institutional market-microstructure tool engineered from Liquidity Economics, combining Kyle (1985) Price-Impact Lambda with Hasbrouck (2009) Square-Root Volume Scaling. In institutional execution desks, Kyle's Lambda measures market illiquidity: how much price moves per unit of incoming order volume.
IMPORTANT — NOT A PRICE-DIRECTION OSCILLATOR:
This subwindow wave measures ORDER-BOOK DEPTH AND LIQUIDITY STRUCTURE rather than bullish or bearish price direction (directional buy versus sell tilt is tracked separately on Line 3 of the HUD). By normalizing live price impact against an 89-bar rolling baseline, the indicator reveals when institutional limit orders are absorbing heavy volume versus when the order book has thinned into a fragile liquidity vacuum across Gold (XAUUSD), Major Forex pairs, and US Indices from M15 to Daily charts.
MATHEMATICAL ENGINE
On every closed bar over InpImpactPeriod (default 14 bars), the indicator computes causal raw Kyle's Lambda using Hasbrouck square-root volume scaling:
Lambda = 10000 * Sum(|ln(C_k / C_{k-1})| * sqrt(V_k)) / Sum(V_k)
expressed in basis points of price movement per square-root tick volume (bps/sqrtV).
It then applies a logarithmic transform and standardizes Lambda against a causal rolling baseline (InpBasePeriod = 89 bars) into an inverted Order-Book Depth Z-Score:
Depth_Z = (Mean_LogLam - LogLam) / Std_LogLam
compressed smoothly via hyperbolic tangent scaling so thresholds remain scale-invariant across symbols and timeframes.
HOW TO READ THE SWINGS AND VISUALS
Subwindow Scale (-4.5 to +4.5, dashed thresholds at +1.5, 0.0, and -1.5):
- UPWARD SWINGS ABOVE ZERO (+Z, DodgerBlue to MediumSpringGreen): Liquidity is DEEPENING (low Kyle's Lambda). Heavy volume is trading while price barely displaces, pointing to institutional limit-order Absorption Walls and active accumulation or distribution zones.
- DodgerBlue Histogram (Book_Deepening, 0.0 to +1.5): Order-book depth building above baseline.
- MediumSpringGreen Bold Histogram (Absorption_Wall, +1.5 and above): Heavy institutional absorption wall holding price firm.
- DOWNWARD SWINGS BELOW ZERO (-Z, DarkOrange to OrangeRed): Liquidity is THINNING (high Kyle's Lambda). Small volume bursts are pushing price rapidly, signaling Liquidity Vacuums, stop-hunt air pockets, and elevated slippage risk.
- DarkOrange Histogram (Book_Thinning, 0.0 to -1.5): Liquidity thinning and price impact rising.
- OrangeRed Bold Histogram (Liquidity_Vacuum, -1.5 and below): Critical thin-book vacuum with fast displacement risk.
- ZERO-LINE CROSSINGS: Signal structural transitions between deep institutional absorption (+Z) and fragile thin-book expansion (-Z).
- WhiteSmoke Smooth Line (Liquidity_Depth_Curve): 5-bar EMA structural liquidity depth trajectory.
- Aqua Dot (Absorption_Lock_Alert) and Magenta Dot (Vacuum_Burst_Alert): Hysteresis-locked confirmation dots printed on the WhiteSmoke curve when depth first crosses +1.5 or -1.5 (resetting only after returning inside +/-0.375 to prevent repeated dot clutter).
DARK TELEMETRY HUD BOX GUIDE
Located in the upper-right subwindow inside a solid dark slate panel with a DodgerBlue border:
- Line 1 (KYLE LAMBDA): Active liquidity regime (ABSORPTION WALL, BOOK DEEPENING, BOOK THINNING, LIQUIDITY VACUUM, or BALANCED BOOK) and live Depth Z-Score.
- Line 2 (IMPACT LAM and DEPTH): Raw price-impact cost in bps/sqrtV alongside the Relative Order-Book Depth Multiplier versus the 89-bar geometric baseline (above 1.00x = deeper than normal; below 1.00x = thinner than normal).
- Line 3 (FLOW TILT): Volume-weighted signed directional return tilt over the 14-bar impact window (BUY PRESSURE at or above +15% in green, SELL PRESSURE at or below -15% in red, or TWO-SIDED in silver) so you immediately know which directional side is pushing into the absorption wall or vacuum.
- Line 4 (BOOK STATE): Direct execution posture (DEEP BOOK / HEAVY ABSORPTION, LIQUIDITY SUPPORT BUILDING, RISING PRICE IMPACT, THIN BOOK / HIGH SLIPPAGE RISK, or NORMAL LIQUIDITY IMPACT).
PRACTICAL USAGE
Spotting Institutional Absorption (+1.5 Wall + Aqua Dot):
When MediumSpringGreen bars surge above +1.5 and print an Aqua dot near key support or resistance, heavy limit orders are absorbing aggressive market flow. Check HUD Line 3 (FLOW TILT): strong Sell Pressure being absorbed inside a deep green wall often marks seller exhaustion near a floor, while strong Buy Pressure absorbed inside a wall can mark overhead supply.
Managing Liquidity Vacuums (-1.5 Vacuum + Magenta Dot):
When OrangeRed bars drop below -1.5 and trigger a Magenta dot (HUD Line 4 reads THIN BOOK / HIGH SLIPPAGE RISK), order-book depth has vanished. Avoid tight-stop fading against HUD Line 3 Flow Tilt and anticipate rapid expansion or wider execution slippage.
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: Kyle_Lambda(14,89).
Core Inputs:
- InpImpactPeriod (Default: 14): Rolling bar window for Hasbrouck square-root Kyle's Lambda and Flow Tilt estimation.
- InpBasePeriod (Default: 89): Rolling normalization baseline for Order-Book Depth Z-Score and Relative Depth Multiplier.
- InpAlertLevel (Default: 1.50): Symmetric Depth Z-Score threshold for Absorption Wall / Liquidity Vacuum bold bars and hysteresis dots.
- InpShowHUD (Default: true): Toggles the 4-line dark telemetry HUD (automatically bypassed during optimization).
Expert Advisor Integration (iCustom Buffers):
Buffer 0: Book_Deepening | Buffer 1: Absorption_Wall | Buffer 2: Book_Thinning | Buffer 3: Liquidity_Vacuum | Buffer 4: Liquidity_Depth_Curve (Smooth Depth Z) | Buffer 5: Absorption_Lock_Alert | Buffer 6: Vacuum_Burst_Alert | Buffer 7: Kyle_Lambda_Bps (Hidden raw price-impact cost in bps/sqrtV).
TIMEFRAME AND ASSET CALIBRATION
Default settings (14 impact bars, 89 baseline bars, 1.50 Z alert) serve as a clean baseline across XAUUSD, Major Forex pairs, and US Indices from M15 to Daily:
- Intraday Execution (M15 to M30 on XAUUSD and US Indices): Lower InpImpactPeriod to 8 to 10 and InpBasePeriod to 55 for faster detection of London and New York liquidity vacuums.
- Swing and Position Analysis (H4 to Daily on Major Forex): Keep InpImpactPeriod at 14 to 20 and InpBasePeriod at 89 to 120 to highlight multi-day institutional accumulation walls and breakdown air pockets.
- Adjusting Alert Strictness: Raise InpAlertLevel to 1.80 to 2.00 to isolate only extreme absorption walls and severe vacuums, or lower to 1.25 on steady, high-liquidity majors.
-----Trading on MetaTrader 5 instead of MetaTrader 4? The identically engineered MetaTrader 5 edition of Kyle Lambda Liquidity Impact is published on my MQL5 Seller Profile with the exact same thumbnail, Hasbrouck square-root liquidity engine, dark telemetry HUD, and parameter set. Visit my seller profile to access the MT5 version.
