Pair Trading Correlation Matrix Dashboard
- Utilità
- Versione: 1.0
- Attivazioni: 10
Pair Trading Correlation Matrix Dashboard is a professional MetaTrader 5 statistical-arbitrage workstation, multi-asset correlation & cointegration matrix, and one-click beta-neutral pair execution utility — rendered onto a single high-DPI canvas with zero chart-object lag.
Most correlation tables show static Pearson coefficients only, leaving traders exposed to trending pairs that drift apart permanently. This dashboard combines an interactive N × N multi-asset heatmap (up to 12 symbols across FX, Metals, Indices, Energy, and Crypto) with live Engle-Granger ADF cointegration p-values, Ornstein-Uhlenbeck Half-Life, Hurst Exponent, OLS & Kalman hedge ratios, dual-chart Spread Studio, atomic one-click 2-leg execution with leg-safety rollback, and an account-wide duplicate-risk & currency exposure radar.
1. Interactive N × N Multi-Asset Matrix (Matrix Tab)
- 3 Live Heatmap Modes (one-click switch):
- CORR — Rolling Pearson or Spearman Rank log-return correlation (−1.00 to +1.00) with recent-vs-full correlation regime drift (Δr) indicators.
- COINT — Engle-Granger ADF MacKinnon p-value heatmap, instantly separating genuinely mean-reverting cointegrated spreads from false correlation traps.
- Z-SCR — Live beta-neutral Spread Z-Score across all N×(N−1)/2 pairs simultaneously, highlighting extreme divergences (±Entry) at a glance.
- Multi-Asset Baskets & Auto Symbol Resolution: 5 built-in presets (FX Majors, Multi-Asset, FX Crosses, Metals+Indices+Oil+Crypto, and Custom CSV up to 12 symbols). Automatically resolves broker suffixes ( .a , .r , .raw , m , Cash , etc.) and index/commodity aliases at runtime.
- Instant Controls: Switch timeframe ( M15 / M30 / H1 / H4 / D1 ), lookback window ( 60 / 120 / 200 / 300 bars), correlation formula ( Pearson / Spearman ), and hedge model ( OLS / Kalman ) directly on the dashboard.
- Click-to-Inspect: Click any matrix cell to load that pair into the Quick Inspector with KPI tiles, live Z-score sparkline, sizing preview, and one-click trade buttons; click again to open the full Spread Studio.
2. Ranked All-Pairs Stat-Arb Scanner (Scanner Tab)
- Continuously evaluates every unordered pair in your basket (up to 66 pairs simultaneously) on bar close and throttled timer intervals — zero tick-spam CPU freezes.
- Displays Return Correlation & Drift, Engle-Granger p-Value, OLS / Kalman Beta, Half-Life (bars), Hurst Exponent (H), Live Spread Z-Score, 0–100 Pair Quality Score, and actionable signal badges ( LONG SPR , SHORT SPR , WATCH , COINT ).
- One-click sorting by |Z| , Score , p-Val , |Corr| , or Half-Life , plus a COINT: ON/ALL filter and pagination.
3. Dual-Chart Spread Studio & Beta-Neutral Execution (Spread Tab)
- Normalized Beta-Adjusted Price Overlay: Plots Leg A against Beta-scaled Leg B (indexed to 100) with shaded divergence fill and live percentage gap.
- Spread Z-Score Curve: Plots the rolling Z-score with shaded entry bands ( ±Z_Entry ), mean-reversion exit targets ( ±Z_Exit ), hard stop boundaries ( ±Z_Stop ), and a live right-axis Z marker.
- Complete Pre-Trade Sizing Preview: Choose Risk % at Z-Stop, Fixed Leg A Lot, or Equal USD Notional with live − / + steppers. Before clicking, see exact Leg A & Leg B lots, Hedge Rounding Drift %, Required Margin & % Equity, 2-Leg Bid/Ask Cost in Z-sigma, and Net Daily Swap.
- Atomic One-Click 2-Leg Execution with Leg-Safety Rollback: Verifies trading sessions, combined free margin, broker volume limits, and filling modes for both legs before sending. Automatically handles both positive and negative beta hedge directions. If Leg B fails after retries, Leg A is rolled back immediately so you are never left with an accidental unhedged directional position.
- Optional Semi-Auto Exit Manager & Orphan Guard: Toggle AUTO EXIT on or off anytime to monitor dashboard-opened pairs for Mean-Reversion Z-Exit, Z-Stop, Money TP/SL, Half-Life / Max-Bar Time Stop, Cointegration Break exit, and Orphan-Leg cleanup.
- One-Click Chart Launch: Jump directly to Chart A or Chart B, or swap legs A/B instantly.
4. Open Pair Manager, Duplicate-Risk Radar & Currency Exposure (Risk Tab)
- Managed Open Pair Baskets: Tracks every dashboard pair across terminal restarts via magic number and pair ID tags, showing Leg A/B lots, Entry Z → Live Z, bars held, swap, net P/L, per-pair CLOSE , and emergency CLOSE ALL .
- Account-Wide Duplicate-Risk Radar: Scans every open position on your account (manual trades and other EAs) against the live correlation matrix, flagging DUPLICATE RISK (correlated same-direction stacking) and NATURAL HEDGE offsets alongside Effective Independent Bets (N_eff) and an overall 0–100 Correlation Risk Score.
- Net Currency Exposure Bars: Horizontal diverging bar chart showing aggregate signed notional exposure per currency/asset ( USD , EUR , GBP , JPY , XAU , indices, etc.) so hidden USD concentration is immediately visible.
5. Institutional Single-Canvas UI, Alerts & CSV Export
- Zero Chart-Object Bloat: Entire workstation renders onto 1 single CCanvas bitmap object. Clean OnDeinit removes 100% of objects.
- Adaptive Themes & High-DPI Scaling: One-click Dark (Obsidian Slate & Emerald Amber) and Light (Porcelain Ivory & Cobalt) themes, automatic or custom 100%–200% DPI scaling, movable by dragging the header bar, and collapsible into a compact live P/L HUD bar.
- Alerts & Quant Export: Optional Popup, Mobile Push, and Sound alerts for cointegrated Z-score signals, correlation regime shifts, and duplicate-risk concentration. One-click CSV export saves the full N × N matrix and ranked scanner ledger to MQL5/Files/ .
- Free Strategy Tester Demo: Includes a Strategy Tester demo mode (active inside MT5 Strategy Tester only; live and demo charts remain strictly under manual/semi-auto control) so you can inspect the statistical engine and pair execution before purchasing.
Note: This utility is an analytical dashboard and discretionary/semi-automated trade execution cockpit. Statistical cointegration and mean-reversion metrics describe historical price relationships and do not guarantee future performance. Always verify broker contract specifications, margin requirements, and risk settings on a demo account before live trading.

