← All posts

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

Cumulative wealth and drawdown curves comparing a three-seed TQC ensemble with IVV across 756 held-out trading sessions from 2019 to 2021
Same 756 held-out sessions · transaction, slippage, and financing costs included

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.

Held-out validation 756 sessions

2019–2021 point-in-time evaluation

Cumulative return +183.9%

IVV returned +99.6% over the same dates

Maximum drawdown −14.2%

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.

  1. 01 Point-in-time panel

    Build lagged return, risk, and market-context features for IVV, IEF, and SHV without future prices.

  2. 02 TQC policy

    Map the current state, portfolio weights, and drawdown to bounded asset allocations.

  3. 03 Cost-aware simulation

    Apply each allocation over the next 21 sessions after transaction, slippage, and financing costs.

  4. 04 Deterministic ensemble

    Average three independently trained policies and compare the resulting daily path with IVV on identical dates.

RESULT

Held-out validation

PeriodTQC returnIVV returnTQC MDDIVV 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

WindowSessionsTQC annualizedIVV annualized
Development1,99534.7%11.9%
Validation75641.6%25.9%
Continuity8401.9%6.5%
Archival A14713.4%28.9%
Archival B10524.3%28.3%

The cost-aware TQC candidate was evaluated across all predefined windows; performance was not uniform across regimes.

Annual returns and maximum drawdowns for the TQC ensemble and IVV in 2019, 2020, and 2021
Year-by-year return and maximum drawdown on the validation window

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.

Evidence

Project repository Point-in-time dataset, training, and evaluation implementation