Releases: stefan-jansen/machine-learning-for-trading
Release list
v3.0.0-alpha.3 — Part II: Research Design and Feature Engineering
Part II is live. These five chapters sit between the data layer (Part I) and the model chapters: they define the trading problem, then turn validated data into model-ready signals — labels, features, and the evaluation that determines what any model can learn.
The code is rolled out in batches over the coming weeks, toward the full launch in July, in book order so every link resolves and the repo stays coherent at each step.
What's here
- Part II — Research Design and Feature Engineering (Chapters 6–10), with READMEs and paired Jupytext notebooks (43 notebooks):
- 6. Strategy Research Framework — defining the trading game before building models: universe rules, decision schedule, cost model, evaluation protocol, and the walk-forward cross-validation discipline that anchors Chapters 7–20.
- 7. Defining the Learning Task — label engineering (forward returns, triple-barrier, trend scanning), information-coefficient inference, multiple-testing control, and causal plausibility checks.
- 8. Financial Feature Engineering — price, volume, microstructure, structural, cross-instrument, and contextual features, with feature selection and robustness testing.
- 9. Model-Based Feature Extraction — features from fitted models: stationarity, structural breaks, fractional differencing, Kalman filters, spectral features, GARCH volatility, and HMM regimes.
- 10. Text Feature Engineering — from bag-of-words to transformers: embeddings, FinBERT sentiment, financial NER, and news-return signal construction.
- The shared
case_studies/utils/package the feature notebooks build on.
Get started
git clone https://github.com/stefan-jansen/machine-learning-for-trading.git
cd machine-learning-for-trading
cp .env.example .env
docker compose pull ml4t # or: pip install uv && uv sync
uv run python data/download_all.py --free-only
uv run python 06_strategy_definition/01_cv_foundations.pyWhat's next
Part III (model development, Chapters 11–15) follows, then the rest in book order. ⭐ Watch or star the repo to follow along, and subscribe to the twice-weekly Insights newsletter.
Live cohort course
Machine Learning for Trading: From Research to Production starts Monday, July 6, 2026 — enrollment for the first cohort closes Friday, July 3. Recordings of the June 24 lightning lessons are still available: Build Multi-Agent Systems You Can Audit and From Trading Idea to Validated Strategy.
Looking for the second edition? It is complete and stable on the second-edition branch — git checkout second-edition.
This is a pre-release. The complete third edition will ship as v3.0.0.
v3.0.0-alpha.2 — Part I: Financial Data
Part I is live. With this tag the repository becomes runnable: clone it, install with Docker or uv, pull the free datasets, and execute the first five chapters end to end.
The code is rolled out in batches over the coming weeks, toward the full launch in July, in book order so every link resolves and the repo stays coherent at each step.
What's here
- Foundation — the shared
utils/library, thedata/download scripts and loaders (free tier needs no API keys), the Docker environments, and the test suite that runs the notebooks in CI. - Part I — Financial Data (Chapters 1–5), with READMEs and paired Jupytext notebooks:
- 1. The Process Is Your Edge — the research-to-production workflow and the evidence boundary that separates exploration from confirmation.
- 2. The Financial Data Universe — a taxonomy of market, fundamental, and alternative data; survivorship bias; storage-format benchmarks.
- 3. Market Microstructure — raw exchange messages to feature-ready bars: NASDAQ ITCH parsing, limit-order-book reconstruction, and bar-sampling methods.
- 4. Fundamental and Alternative Data — point-in-time SEC EDGAR pipelines, entity resolution, and alternative-data evaluation.
- 5. Synthetic Financial Data — TimeGAN, Tail-GAN, Sig-CWGAN, and diffusion generators for robust validation when history is short.
Get started
git clone https://github.com/stefan-jansen/machine-learning-for-trading.git
cd machine-learning-for-trading
cp .env.example .env
docker compose pull ml4t # or: pip install uv && uv sync
uv run python data/download_all.py --free-only
uv run python 01_process_is_edge/factor_regimes.pyWhat's next
Part II (research design and feature engineering, Chapters 6–10) follows, then the rest in book order. ⭐ Watch or star the repo to follow along, and subscribe to the twice-weekly Insights newsletter.
Free Lightning Lessons — Wednesday, June 24, 2026
- Build Multi-Agent Systems You Can Audit — 15:00 UTC
- From Trading Idea to Validated Strategy — 16:00 UTC
The live cohort course From Research to Production starts July 6, 2026.
Looking for the second edition? It is complete and stable on the second-edition branch — git checkout second-edition.
This is a pre-release. The complete third edition will ship as v3.0.0.
v3.0.0-alpha.1 — Third Edition: Landing
The third edition of Machine Learning for Trading is a ground-up rebuild, organized around one end-to-end workflow: how you take a research idea and develop it into a strategy you can run — and keep running — in a live market.
The code is rolled out in batches over the coming weeks, toward the full launch in July. This first tag publishes the landing page and project map; chapters and notebooks follow part by part, each one runnable on free data when it lands.
What's here
- The full map of the edition — 27 chapters across six workflow-aligned parts, the nine case studies, and the six production
ml4t-*libraries — all described inline. - Links to the companion website, 112 primers, and 56 agent skills.
What's new in the third edition
- Transaction costs and risk management as full chapters, joining portfolio construction and strategy synthesis — a raw signal carried through to a sized, cost- and risk-aware portfolio.
- A production track: live trading systems, MLOps, and governance.
- Generative AI and autonomous agents — RAG on filings, knowledge graphs, and multi-agent research systems.
- A wider model toolkit, causal ML, reinforcement learning, and synthetic financial data.
What's next
Part I (data infrastructure, Chapters 1–5) lands next, followed by the rest in book order. ⭐ Watch or star the repo to follow along, and subscribe to the twice-weekly Insights newsletter.
Free Lightning Lessons — Wednesday, June 24, 2026
- Build Multi-Agent Systems You Can Audit — 15:00 UTC
- From Trading Idea to Validated Strategy — 16:00 UTC
The live cohort course From Research to Production starts July 6, 2026.
Looking for the second edition? It is complete and stable on the second-edition branch — git checkout second-edition.
This is a pre-release. The complete third edition will ship as v3.0.0.
2nd Edition
This release comes with a new Docker image that uses only two environments with updated libraries. The notebooks use the environment ml4t (Python 3,8) throughout except for a dozen or that use the backtest environment to run Zipline 1.4.1 with Python 3.6 for backtesting.
I've tried to address the various bugs reported over the last several months since publication, and will continue to do so.