EMH Agent
Cost-aware 3-year validation · TQC +183.9% vs. IVV +99.6%
Built with Python · TQC · Point-in-time data · Gymnasium · Stable-Baselines3
WHY
Could a model make investment decisions more consistently than emotion-driven human judgment? To test that question fairly, the agent had to use only information available on each date and be evaluated after realistic trading, slippage, and financing costs. The goal was a reproducible decision process, not a backtest that benefited from future information.
2019–2021 point-in-time evaluation
IVV returned +99.6% over the same dates
Compared with −33.8% for IVV
HOW
From point-in-time observations to a cost-aware portfolio
Each decision uses a frozen historical panel and is scored only after trading frictions have been deducted.
- 01 Point-in-time panel
Build lagged return, risk, and market-context features for IVV, IEF, and SHV without future prices.
- 02 TQC policy
Map the current state, portfolio weights, and drawdown to bounded asset allocations.
- 03 Cost-aware simulation
Apply each allocation over the next 21 sessions after transaction, slippage, and financing costs.
- 04 Deterministic ensemble
Average three independently trained policies and compare the resulting daily path with IVV on identical dates.
RESULT
Held-out validation
| Period | TQC return | IVV return | TQC MDD | IVV MDD |
|---|---|---|---|---|
| 2019 | +32.1% | +31.1% | −5.3% | −6.6% |
| 2020 | +56.5% | +18.4% | −14.2% | −33.8% |
| 2021 | +37.2% | +28.7% | −5.9% | −5.1% |
| Full period | +183.9% | +99.6% | −14.2% | −33.8% |
Returns are computed from the reproduced daily paths of the same validation window.
Five-window stress test
| Window | Sessions | TQC annualized | IVV annualized |
|---|---|---|---|
| Development | 1,995 | 34.7% | 11.9% |
| Validation | 756 | 41.6% | 25.9% |
| Continuity | 840 | 1.9% | 6.5% |
| Archival A | 147 | 13.4% | 28.9% |
| Archival B | 105 | 24.3% | 28.3% |
The cost-aware TQC candidate was evaluated across all predefined windows; performance was not uniform across regimes.
Contribution
- Built the point-in-time data contract, cost-aware portfolio environment, TQC training loop, and deterministic multi-seed evaluator.
- Separated research proposals from execution authority through typed policy gates, receipts, and reconciliation boundaries.