Quant research & backtesting

quantlab — From Trading Ideas to Reproducible Backtests

Great backtest? Audit it first. Illustration · simulated data

The cover chart is an illustration with simulated data, not real performance.

Turn a futures trading idea into a backtest you can rerun. For an existing strategy, check its components and retest changes in the full backtest.

The problem

A trading idea needs explicit rules for entries, exits, position size, fills, and costs. With an existing backtest, the question is often which rule to examine first. My own early futures strategies fell apart out of sample after parameter optimization. That experience led me to build controlled comparisons and out-of-sample checks into the research process.

My role and the implementation

I define the research questions and design the comparisons. I built the workflow with AI Agents.

  • Strategy backtesting. Connect historical prices, signals, entry and exit rules, and position sizing to simulated fills and costs. Each run produces a trade log and account results.
  • Ten-stage analysis. Compare strategy components under the same assumptions. For example, hold entries, position sizing, and costs fixed while testing an exit rule, then check the change in the full strategy.
  • Batch research. AI Agents help me plan experiments. Python runs the agreed comparisons in batches and generates reports that trace results back to their data and rules. I review the evidence and decide what to test next.

Data and validation

  • Data: ingested 16 years of CME minute data; built continuous futures and information-driven bars; contracts are identified by code plus validity interval, with a guard before anything is written.
  • Validation: purged K-fold, combinatorial cross-validation, walk-forward and stress tests; triple-barrier labels and meta-labeling.
  • Discipline: criteria written down before testing (pre-registration), provenance checks, multiple-testing corrections, and independent reviews of key conclusions.
  • Consistency: batch and bar-by-bar online computations match bit for bit; research-side backtests match the Nautilus engine bar by bar on controlled test data.

Results

  • Two fixed-scope trials on historical market data completed experiment registration, batch runs, comparisons, and reporting.
  • Across 16 years, 2,211 contracts, and 164M bars, all 1,386 rolls matched between batch and bar-by-bar processing.
  • Found three traps in long histories: single-digit-year contract codes repeat every decade, codes get reassigned in their expiry month, and the same instrument_id is reused for other products.
  • Peak memory of sample-uniqueness weighting cut from 81.75 GB to 0.10 GB.
  • An earlier pre-registered screen of 11 signal families (77 configurations) and 6 trend filters found no robust excess return. That conclusion belongs to that study, not all subsequent research. I have not put my own quantitative strategies into live operation.

Stack

Python · pandas · NumPy · Numba · scikit-learn · PyArrow / Parquet · Nautilus Trader · Databento · pytest

Need something similar? Email me: jacobxie@hotmail.com

← Back to home