Research systems case study · 03
Independent project · Local research platform
Mill
A quant research lab where AI proposes trading ideas and the system tests the evidence. From market data to a reasoned verdict, every experiment leaves a trail.
- market-data bars
- 42.3M
- datasets in the local lake
- 23
- interfaces, one service
- 3
Start with data you can trust
The hard part of a research tool is knowing what its numbers mean. Mill keeps the source, volume units, trading sessions, feed, and adjustment policy attached to each dataset. FX tick counts, equity shares, and crypto volume may share a column name, but they cannot be treated as interchangeable.
The partitioned Parquet lake is read with DuckDB and Polars, with incremental refresh, coverage checks, and venue-specific calendars. The local snapshot contains 42,338,649 bars across 23 Dukascopy datasets. Binance and Alpaca adapters are implemented separately; those feeds are not part of that snapshot count.
Make the backtest earn its numbers
Signals enter at the next bar's open. Exits account for gaps and resolve ambiguous same-bar stop/target hits pessimistically. Position sizing uses the actual stop distance, while costs include spread, slippage, commission, financing, and currency conversion where applicable.
Before strategy metrics are reported, prefix recomputation and future-price perturbation check whether a signal changes when it can see data it should not know. Agent-facing reads also enforce a holdout boundary in the service. These checks reduce routes to accidental look-ahead; they do not prove that a strategy will generalize.
Look beyond a good Sharpe
The statistical referee combines stationary-bootstrap tests, deflated Sharpe adjusted for effective trial count, matched random-entry comparisons, parameter-neighborhood stability, and multiple-testing correction for declared families.
Every attempt enters a fingerprinted ledger, including failed or refused runs. Similar trials can be recognized, and the research history informs the multiple-trial adjustment. Reports identify missing evidence explicitly: an undeclared parameter neighborhood or an unrun random-entry test remains an absence, never an implied pass.
Give agents room to research
A resident agent works through scout, build, and judge phases: source a hypothesis, write and backtest a strategy, then record a verdict. It uses a small Python harness around Codex CLI, with wall-clock limits, rate-limit handling, a kill switch, and an explore/exploit scheduler.
HTTP, CLI, and MCP expose the same typed service. Holdout restrictions, evidence-backed journal writes, originality checks, and concurrency limits live underneath those interfaces. A phase succeeds only when the required state exists in Mill; a confident agent transcript is not enough.
Keep the evidence in view
The React cockpit connects data coverage, trial families, candlestick charts, trade markers, equity and drawdown, cost breakdowns, research history, and agent oversight. Bars and overlays are applied as one chart scene so a trade marker stays attached to the data it describes.
Mill is a research system, not a live trading service. The screens show historical backtests, not realized returns. The model still has explicit limitations, including assumed slippage, a fixed historical financing calibration, and survivorship bias in the current-equity universe. Keeping those assumptions visible is part of the product.


