XAUtify Gold Correlation
- Experts
- Version: 2.55
- Updated: 27 May 2026
- Activations: 10
XAUtify is an advanced quantitative trading system engineered specifically for the XAUUSD (Gold) market. Unlike conventional retail Expert Advisors that rely on lagging directional indicators such as moving averages, RSI, or MACD, XAUtify is built on a multi-proxy correlation and statistical arbitrage framework. It actively monitors the mathematical relationship between Gold and a predefined basket of correlated assets—including major currency pairs and the US Dollar Index—to identify structural pricing inefficiencies.
The core methodology is based on statistical mean-reversion. Financial assets with strong historical correlations tend to move together. When they diverge significantly, it often indicates a temporary pricing anomaly that will eventually correct itself. XAUtify calculates these divergences in real-time, waiting for extreme statistical stretches before executing trades to capture the reversion back to the mean.
Core Mathematical Components
1. Multi-Proxy Cointegration Rather than looking at Gold in isolation, XAUtify cross-references XAUUSD against multiple proxies (e.g., AUDUSD, USDCHF, XAGUSD, USDCAD). By measuring the spread between Gold and these assets, the system constructs a highly accurate relative valuation model.
2. Dynamic Kalman Filtering Financial markets are exceptionally noisy. Traditional moving averages suffer from lag and react poorly to sudden volatility spikes. XAUtify implements a dynamic Kalman filter, a recursive algorithm that filters out price noise to continuously estimate the true, underlying fair value of the asset. This provides a much smoother and more accurate baseline for the mean-reversion calculations.
3. Z-Score Execution Logic XAUtify does not trade based on fixed pip distances or grid spacing. Instead, it measures price deviations using statistical standard deviations (Z-Scores). A high Z-Score indicates that the current price is a statistical outlier compared to its historical mean. Users can precisely define the Z-Score threshold required to open a trade, allowing for highly calibrated strike rates.
4. Market Regime Detection Mean-reversion strategies thrive in ranging markets but can struggle during structural, momentum-driven breakouts. XAUtify includes a built-in market regime filter that evaluates real-time volatility using Average True Range (ATR) and directional strength metrics. It classifies the market environment into ranging, trending, or highly volatile states, automatically blocking new entries when market conditions become hostile.
Execution and Risk Management
Time-Weighted Average Price (TWAP) Institutional traders rarely execute massive orders in a single block due to slippage and liquidity constraints. XAUtify features a TWAP slicing engine. If an entry signal is generated, the EA can automatically slice the total position size into smaller sub-orders executed over time, drastically reducing slippage impact on large accounts.
Dynamic Position Sizing Users are not limited to fixed lot sizes. XAUtify offers multiple capital allocation methodologies, including Fixed Risk Percentage, Kelly Criterion, and Value-at-Risk (VaR) based sizing. The VaR model calculates the maximum expected loss over a specific timeframe and adjusts the lot size to ensure the account remains within strict confidence intervals.
Comprehensive Account Protectors Risk management is the absolute priority of the XAUtify engine. The system includes multiple layers of defense:
- Daily Circuit Breakers: Hard stops trading if a user-defined daily loss percentage is reached.
- Weekly Drawdown Limits: Halts execution if the maximum weekly drawdown is breached.
- Peak Equity Trailing (High-Water Mark): Drawdowns can be calculated from the absolute peak equity of the account, protecting open profits.
- Basket Trailing Stops: Secures profits across all open proxy positions simultaneously by trailing the aggregate account equity.
Comprehensive Input Parameters
[00] System Identity & Logging
- InpMagicNumber: Unique numeric identifier for EA trades. Must be unique if running multiple instances.
- InpEnableHUD: Toggles the on-chart graphical telemetry dashboard.
- InpDebugLogs: Prints detailed engine calculations and statistical metrics in the Experts tab.
[01] Statistical Arbitrage Engine
- InpProxySymbols: Comma-separated list of correlated assets to track. These must be visible in your Market Watch window.
- InpDXYSymbol: Your broker's specific ticker name for the US Dollar Index.
- InpPrimaryTF: The timeframe utilized for baseline statistical calculations.
- InpZScoreEntry: Standard deviation threshold required to trigger an entry.
- InpZScoreExit: Standard deviation threshold to secure profit.
- InpZScoreStop: Hard invalidation threshold to close a statistically failed setup.
- InpRegimeFilter: Enables volatility detection to block entries during structural breakouts.
- InpSimulationMode: Enables dry-run logging. The EA will calculate and log signals without executing real trades.
[02] Risk & Capital Management
- InpRiskPerTrade: Base allocation percentage of account equity per signal.
- InpDailyMaxDD: Daily equity drawdown limit percentage.
- InpDailyPnLLimitPct: Fixed daily loss circuit breaker percentage.
- InpDDBase: Determines if drawdown is calculated from initial balance or peak high-water mark.
- InpVaRConfidence: Confidence level for Value-at-Risk position sizing.
- InpEquityTrailPct: Trailing stop percentage applied to overall account equity.
- InpBasketTargetPct: Hard target to close all trades once aggregate equity grows by this percentage.
- InpMoneyMode: Lot sizing method (Fixed Lot, Fixed Risk, Kelly, VaR).
- InpFixedLot: Default lot size if Fixed Lot mode is selected.
- InpAllowScaling: Permits the EA to average cost if the statistical anomaly widens.
- InpWeeklyMaxDD: Weekly equity drawdown limit percentage.
- InpTrailingStop: Distance for the dynamic trailing stop loss.
- InpTrailingStep: Step increment required to move the trailing stop loss.
[03] Institutional Execution Engine
- InpExecutionSlices: Number of sub-orders for TWAP execution (e.g., 4 slices splits 1.00 lot into four 0.25 lot orders).
- InpSlippageATRMult: ATR multiplier to determine dynamic safe slippage bands instead of fixed points.
[04] Session & Spread Filters
- InpSessionStart / InpSessionEnd: Active trading window hours based on your broker's server time.
- InpMaxSpreadUSD: Maximum allowed spread threshold before execution is temporarily blocked.
[05] Advanced Account Protectors
- InpProtTargetEquity: Target equity amount to cease trading upon reaching.
- InpProtMarginShield: Prevents trading if free margin drops below a specific threshold.
- InpProtFridayLiq: Automatically liquidates all open positions before the weekend close.
Setup Instructions
- Open your terminal and ensure that all symbols listed in the InpProxySymbols input are fully visible in your Market Watch window. XAUtify requires active price data from these proxies to construct the correlation matrix.
- Attach the EA to a single XAUUSD chart. The timeframe of the chart does not strictly matter, as the engine explicitly requests data based on the InpPrimaryTF parameter.
- Ensure your VPS connection is stable, as statistical arbitrage systems require continuous real-time tick flow to calculate standard deviations accurately.
- For ranging markets, a lower InpZScoreEntry (e.g., 1.5 to 2.0) is generally optimal. During highly volatile conditions, increasing this parameter (e.g., 2.5 to 3.0) requires a stronger mathematical anomaly before the EA will trade.
- It is highly recommended to utilize the InpSimulationMode first. This allows you to observe how the Z-Score engine behaves and logs signals in real-time under your broker's specific conditions before risking live capital.
