Marchenko Pastur RMT Denoiser MT4
- 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.20
- Attivazioni: 5
OVERVIEW AND SCIENTIFIC ORIGIN
The Marchenko Pastur RMT Denoiser is a quantitative spectral filter engineered from Random Matrix Theory (RMT) and Quantitative Econophysics, implementing the Marchenko-Pastur Eigenvalue Law, the Laloux-Cizeau-Bouchaud-Potters (LCBP) bulk noise boundary, and Baik-Ben Arous-Peche (BBP) signal subspace shrinkage natively in MQL without external DLLs.
In institutional econophysics and quantitative portfolio desks, Random Matrix Theory separates genuine non-random market structure from random Wishart correlation noise. Standard moving averages and oscillators react equally to real trends and random choppy fluctuations. This strictly causal, non-repainting indicator diagonalizes a live 6x6 correlation matrix on every bar, mathematically clips all eigenvalues that fall inside the random-noise bulk, and plots only statistically validated directional eigenmodes across Gold (XAUUSD), Major Forex pairs, and US Indices.
FOUR-STEP RANDOM MATRIX ENGINE
1. Velocity Embedding and 6x6 Gram Matrix: Applies a causal 5-bar EMA velocity pre-filter, dampens extreme wick outliers via hyperbolic tangent winsorization, and constructs a 6x6 exponentially weighted correlation matrix across stride-4 lags over InpWindowM (default 30).
2. Exact Cyclic Jacobi Eigenvalue Solver: Diagonalizes the 6x6 matrix on every bar (A = V * Lambda * V^T) to extract all 6 live eigenvalues and eigenvectors.
3. Marchenko-Pastur Noise Clipping: Computes the dynamic LCBP upper noise edge MP+ = InpMPMult * sigma_bulk^2 * (1 + sqrt(6 / M))^2. Any eigenmode with lambda_k <= MP+ falls inside random Wishart noise and is hard-clipped to zero.
4. BBP Subspace Projection: Reconstructs the clean directional wave exclusively from surviving eigenmodes above MP+ using optimal BBP squared-edge shrinkage sqrt(1 - (MP+ / lambda_k)^2).
SUBWINDOW VISUAL GUIDE
Subwindow Scale (-4.5 to +4.5, dashed breakout levels at +1.5, 0.0, and -1.5):
- MediumTurquoise Histogram (RMT_Bull_Signal): Validated coherent bullish eigenmode piercing above MP+.
- OrangeRed Histogram (RMT_Bear_Signal): Validated coherent bearish eigenmode piercing above MP+.
- DimGray Histogram (RMT_Clipped_Noise): Background noise rejected when 0/6 eigenmodes clear MP+ (shown muted in gray so you can see exactly what chop the filter suppressed).
- WhiteSmoke Line (MP_Denoised_Curve): Clean denoised trend trajectory that flatlines at 0.00 during random noise and expands only when genuine structure clears MP+.
- Cyan Dot (Bull_Eigen_Lock) and Gold Dot (Bear_Eigen_Lock): Reversal-locked breakout dots plotted strictly when a validated signal mode flips beyond +/-1.5 (InpBreakoutLevel).
DARK TELEMETRY HUD BOX GUIDE
Anchored in the upper-right subwindow inside a dark slate panel with a DodgerBlue border:
- Line 1 (RMT DENOISER): Live spectral verdict (BULL SIGNAL MODE, BEAR SIGNAL MODE, MODE TRANSITION, or MP NOISE CLIPPED) and denoised signal score.
- Line 2 (MAX EIGEN vs MP+): Compares the leading eigenvalue (lambda_1) directly against the live MP+ random-noise boundary and shows the breakout ratio (readings above 1.00x confirm non-random coherence).
- Line 3 (SIGNAL MODES and CLEAN VAR): Count of surviving eigenmodes out of 6 above MP+ (K/6) and the percentage of total matrix variance captured by those signal modes.
- Line 4 (FILTER STATE): Clear spectral gate readout (COHERENT EIGENMODE PASSED, EIGENMODE PIVOTING, or RANDOM NOISE SUPPRESSED).
IMPORTANT CALIBRATION NOTE — IF YOUR CHART SHOWS MOSTLY GRAY BARS
Because Random Matrix Theory enforces a strict mathematical noise floor, different symbols and timeframes show different amounts of gray versus colored bars by design. Range-bound Forex pairs or lower timeframes naturally spend more time inside random noise (0/6 modes passing, flat WhiteSmoke line at 0.00).
If a specific chart looks mostly gray and you want to reveal more active Turquoise and OrangeRed signal waves, simply calibrate two inputs:
- Lower InpMPMult from 1.00 down to 0.75 to 0.85: Relaxes the Marchenko-Pastur MP+ noise ceiling so more coherent directional waves clear the filter on quieter pairs and intraday charts.
- Adjust InpWindowM (default 30): Lower to 20 to 25 for faster intraday responsiveness on M15 to M30 charts, or raise to 40 to 60 on H1 to D1 charts to lower the theoretical MP+ threshold and reveal longer macro eigenmodes.
PRACTICAL USAGE
Validated Trend Entries:
Wait for DimGray noise bars and the flat 0.00 WhiteSmoke line to break cleanly into MediumTurquoise (bullish) or OrangeRed (bearish) waves accompanied by a Cyan or Gold eigen-lock dot beyond +/-1.5, with HUD Line 2 confirming MAX EIGEN above MP+ (>1.00x) and Line 4 reading COHERENT EIGENMODE PASSED.
Noise Suppression Filter:
When bars remain DimGray, the WhiteSmoke line rides flat along 0.00, and HUD Line 4 reads RANDOM NOISE SUPPRESSED (0/6 modes), avoid trend-following entries and let other breakout bots stand aside.
TECHNICAL SPECIFICATIONS AND INPUT PARAMETERS
Calculation Engine:
100% causal bar-by-bar Jacobi matrix solver with zero repainting, zero backpainting, and zero external DLL calls. Short name: MP_Denoiser(30).
Core Inputs:
- InpWindowM (Default: 30, Range 15 to 100): Effective matrix correlation window M controlling both smoothing horizon and the Marchenko-Pastur aspect ratio (6 / M).
- InpMPMult (Default: 1.00, Range 0.75 to 1.40): Multiplier scaling the MP+ noise ceiling (lower = more colored signals pass; higher = stricter noise rejection).
- InpBreakoutLevel (Default: 1.50): Symmetric breakout level for reversal-locked Cyan and Gold eigen-lock dots.
- InpShowHUD (Default: true): Toggles the 4-line dark telemetry panel (bypassed during optimization).
- InpMaxBars (Default: 2500): Maximum historical bars calculated on initial chart load.
Expert Advisor Integration (iCustom Buffers):
Buffer 0: RMT_Bull_Signal | Buffer 1: RMT_Bear_Signal | Buffer 2: RMT_Clipped_Noise | Buffer 3: MP_Denoised_Curve | Buffer 4: Bull_Eigen_Lock | Buffer 5: Bear_Eigen_Lock | Buffer 6: RMT_Max_Eigen (Hidden: leading eigenvalue) | Buffer 7: RMT_MP_Edge (Hidden: live MP+ threshold).
TIMEFRAME AND ASSET CALIBRATION SUMMARY
Default settings (InpWindowM = 30, InpMPMult = 1.00, InpBreakoutLevel = 1.50) serve as a clean baseline for XAUUSD, Major Forex pairs, and US Indices across M15 to H4:
- Intraday M15 to H1 (FX Majors and Quieter Sessions): Try InpMPMult = 0.80 to 0.90 and InpWindowM = 24 to 35 if the default 1.00 setting clips too much activity into gray.
- Trending Assets and Higher Timeframes (XAUUSD, US30, H4 to D1): Keep InpMPMult at 0.95 to 1.15 and InpWindowM at 30 to 50 to isolate only high-variance institutional trend regimes.
-----Trading on MetaTrader 5 instead of MetaTrader 4? The identically engineered MetaTrader 5 edition of Marchenko Pastur RMT Denoiser is published on my MQL5 Seller Profile with the exact same thumbnail, 6x6 Cyclic Jacobi eigenvalue solver, Marchenko-Pastur noise clipping, dark telemetry HUD, and parameter set. Visit my seller profile to access the MT5 version.
