Z-Gate is an institutional-grade, hybrid multi-agent statistical arbitrage trading system engineered for Alpaca Paper Trading. It runs two concurrent market-neutral strategies across 12 cointegrated pairs: directional equity options during market hours and 24/7 cryptocurrency spot. 1. Mathematical Alpha & Dynamic Hedging Traditional pairs trading suffers from static OLS lookahead bias and microstructure noise. Z-Gate implements a recursive State-Space Kalman Filter to estimate continuous time-varying hedge ratios (beta). Spreads are modeled via an Ornstein-Uhlenbeck (OU) mean-reverting stochastic process (dS_t = kappa*(mu - S_t)dt + sigma*dW_t). Trades enter only on genuine statistical dislocations (|Z| >= 1.50-1.75 sigma) with verified Engle-Granger cointegration (p <= 0.05). 2. Dynamic Options Half-Life Expiration Snapping A core innovation of Module A is linking target option contract expiration (DTE) directly to the calibrated OU mean-reversion half-life (tau = ln(2)/kappa). Contracts are snapped to DTE = clamp(tau * 2.5, 7, 30), ensuring directional ATM calls/puts have sufficient runway for spread convergence without suffering from terminal theta decay. 3. Deterministic Safety Boundary & Zero-LLM Execution While LLM agents (Featherless / Groq) provide advisory sentiment nudges and nightly trade reviews, the Risk Agent and Execution Agent are 100% deterministic Python. A 9-rule gate enforces fractional Kelly sizing (1.5% max risk at stop-loss), cointegration thresholds, and circuit breakers with zero LLM hallucination risk. 4. Verified Performance & Cloud Deployment Historical multi-year backtesting across 4 years of daily equity bars and 7 months of hourly crypto bars yielded +80.72% net return, a 3.52 profit factor, 2.06:1 win/loss ratio, and <6.0% max drawdown with 107/107 passing unit tests. Z-Gate is fully containerized and live 24/7 on cloud infrastructure with real-time web telemetry.
Category tags: