Personal

Quantrade Research System

Overlapping feature windows feeding a neural model and side-by-side research comparison tiles.

Problem

I built Quantrade as a personal research system for machine-learning trading strategies. I wanted to compare ideas on consistent data and evaluation rules, rather than judge a model by prediction accuracy or a favourable chart alone. Trading fees, drawdown and the order of training and test data all change how useful a result is.

Architecture

A Python research library connects market-data providers, feature preparation, PyTorch trainers and fee-aware trade simulations. A YAML-driven multiprocessing runner executes comparable benchmark plans and writes result tables, while streaming feature and account models connect the same research ideas to an event-driven strategy interface.

What I built

  • Built configurable PyTorch regression and classification training, backtesting and plotting around lookback windows, log returns, lag features and autocorrelation analysis.
  • Built simulations reporting compounded equity, annualised Sharpe, drawdown and liquidation events.
  • Built benchmark runners and a linear-model baseline, with Altair charts for inspecting individual runs.
  • Added shared data access for Binance candles, Alpaca equities and Hyperliquid perpetuals, including local caching, exchange fees and bulk downloads where supported.
  • Built incremental tick windows, log-return features and Decimal-based order, position and account models for a reference ML strategy.

Engineering decisions

  • Training and test data stay time ordered rather than being shuffled; fixed random seeds and deterministic backend settings improve repeatability within a controlled environment.
  • Maker and taker fees remain separate so gross and net results are visible.
  • A linear model provides a simpler benchmark before neural models.
  • Providers share retrieval code without assuming their market behaviour is interchangeable, and streaming windows avoid rebuilding the full history for every event.

Technologies

Python 3.12 (uv), PyTorch, polars and pandas, scikit-learn, Altair, Binance / Alpaca / Hyperliquid APIs.

Results

Quantrade gives me a repeatable workflow for comparing model configurations in trading terms, with fees and drawdown alongside predictive performance. Benchmark tables and charts make differences between experiments easier to inspect and help decide which ideas warrant further investigation.

Chronological splits are only part of sound evaluation: feature preparation can still introduce future information, and selecting from many benchmark runs can overfit the evaluation data. I treat the rankings as research results, not evidence of a profitable strategy.

Have a Python, AI or automation problem?

Tell me what is slowing the business down, what you have tried, and what a successful outcome looks like. I'll help you identify the most sensible next step.