Hawkes Process: Order-Flow Dynamics Engine
View Repository SourceA multivariate linear Hawkes process engine with analytic gradients and exact Ogata-thinning, leading to a rigorously proven empirical negative result.
I developed a multivariate linear Hawkes process engine designed for analyzing order-flow dynamics on seconds-to-minutes horizons, explicitly targeting execution alpha and adverse-selection timing rather than latency-race HFT.
Formal Analytics and Stability
The engine’s fully analytic, provably tractable core (Tier A) was certified via a formal mathematical spec. I implemented:
- Exact Ogata-thinning simulations.
- A global concave log-likelihood with analytic gradients for fixed timescale banks.
- Spectral radius guards ($\rho(\Gamma) < 1$) to stringently enforce process stability.
Rigorous Backtesting
I engineered a purged and embargoed walk-forward backtest harness. This wasn’t a naive price-snapshot test; it featured queue-position-aware fill simulation complete with exchange rebates, realistic latency, and tick constraints. The integrity of the harness itself was verified using a hindsight-optimal oracle and random leakage controls.
The Honest Negative Result
After all this engineering, the system reached a clean empirical negative result. Out-of-sample expected forward moves ($\sim 0.0005$) were a full order of magnitude smaller than half-spread costs ($\sim 0.005$).
This proved unequivocally that while the model had weak statistical predictability (a genuinely positive IC), the signal was economically unexploitable after accounting for true transaction friction.