The Third Edition Publishes Tomorrow
What is new since 2020: the research process front and center, nine cross-asset case studies, six open libraries, 459 notebooks, 112 primers, and 61 agent skills.
The third edition of Machine Learning for Trading will be available tomorrow. Six years in the making, it is a rebuild from th ground up: one research-to-production workflow, applied across nine markets, with an open ecosystem of libraries, notebooks, primers, and agent skills that provide an all-around learning experience and implementation support.
Antonio Gulli, Senior Engineering Director in Google’s Office of the CTO, and author of the excellent book Agentic Design Patterns (among many others) wrote the foreword: “I definitely recommend this book if you want to understand finance in the modern AI and agentic world. It’s a definitive guide.”
I am walking through the new edition in a 30-minute session next Thursday, July 30 at 11:00 a.m. ET: how the 27 chapters map to the research workflow, how the nine case studies and the companion code fit together, and which route through the material fits which goal. Register here.
Here is what is new.
The research process, front and center
The second edition had a workflow. The third puts it front and center.
The ML4T research workflow: data acquisition, feature engineering, model training and selection, strategy simulation, portfolio construction, cost and risk analysis, and live deployment, with an iterate-and-redeploy loop back to data.
The stages before modeling now get real treatment: how to turn a trading idea into a specification with an economic hypothesis, a universe, a horizon, and constraints; how to define the learning task, because the label choice determines what a model can learn; how to build financial features, model-based features, and text features without leaking the answer.
The stages after modeling are separated into four dedicated chapters. The second edition covered backtesting as historical simulation. The third splits the decisions that produce a simulation worth running into strategy simulation, portfolio construction, transaction costs, and risk management, then adds a fifth chapter that analyzes the nine case studies side by side to show how different design choices behave.
Nine cross-asset case studies
Each case study carries a research question from raw data through labels, features, models, backtests, costs, and risk to a deployment assessment. They are complete research projects, organized as pipelines instead of isolated demonstrations of one method.
US firm characteristics, a US equities panel, S&P 500 equities plus options analytics, CME futures, ETFs, crypto perpetuals, S&P 500 options, FX pairs, and NASDAQ-100 intraday microstructure. The studies range from 15-minute intraday data to monthly equity panels.
All nine follow the same sequence of research phases, while the model families, features, and horizons vary where the market requires it. That shared phase order is what makes it possible to see where market structure, data availability, and trading costs actually differ across asset classes.
The new chapters
Everything below is either new to this edition or rebuilt from the ground up. Each links to its chapter guide.
5. Synthetic Financial Data for the situation where you do not have enough history to test what you want to test.
6. Strategy Research Framework, turning a trading idea into a testable specification.
9. Model-Based Feature Extraction, features that are themselves model output, with the leakage discipline that requires.
13. Deep Learning for Time Series, greatly expanded to the architectures that now matter.
15. Causal Machine Learning, in this book for the first time. Most of what a researcher wants to know about a strategy is a causal question, and this chapter treats it as one.
16-19. Strategy Simulation, Portfolio Construction, Transaction Costs, Risk Management, four chapters where the second edition had one on backtesting.
21. Reinforcement Learning for Execution and Hedging. The second edition trained a deep Q-learning agent to trade the stock market. The third shifts the emphasis to optimal execution, market making, and deep hedging.
22. RAG for Financial Research, retrieval over filings, research, and news.
23. Knowledge Graphs, for the questions where relational structure earns its cost.
24. Autonomous Agents, for both forecasting and research.
25. Live Trading Systems and 26. MLOps and Governance, carrying the workflow into production, monitoring, and the two sources of live failure.
20,000 stars
The companion repository passed 20,000 stars this month, with more than 5,400 forks. It went through GitHub Trending in June alongside karpathy/nn-zero-to-hero and microsoft/ai-agents-for-beginners.
That repository is where the book actually lives. Everything below is in it.
Six open Python libraries
The workflow as installable code, one package per stage, each documented and usable on its own:
ml4t-data (repo), unified market-data acquisition from 19+ providers behind one interface
ml4t-engineer (repo), features, labels, alternative bars, and leakage-safe dataset preparation
ml4t-models (repo), finance-native latent factors, stochastic discount factors, direct prediction, and portfolio learning
ml4t-diagnostic (repo), feature validation, strategy diagnostics, and the Deflated Sharpe Ratio
ml4t-backtest (repo), event-driven backtesting with realistic execution
ml4t-live (repo), production trading with broker integrations
What makes them finance-native is specific: point-in-time data contracts, financial labels, purged and embargoed validation, transaction-cost models, and broker parity.
459 notebooks
Every chapter and every case study is executable, and all of it goes live today in the companion repository.
The data stack has moved from pandas to Polars, which cuts memory use and execution time in the larger research pipelines.
112 primers and 61 agent skills
The primers hold the prerequisites and specialized extensions that would otherwise interrupt the chapters, so the book can assume a concept and link to its explanation.
The agent skills encode repeatable research tasks together with their checks, covering lookahead bias, data leakage, walk-forward validation with purging and embargo, cost models, position sizing, and production workflows. They are for readers running a coding agent inside their research loop.
Courses
Live cohorts and workshops that apply the process to your own research with feedback, for readers who want more than a description.
Where to start
Choosing a market: open the case study closest to what you trade and follow it through the workflow chapters.
Building infrastructure: start with ml4t-data and ml4t-backtest. Both are usable without adopting the rest of the stack.
Here for what changed since 2020: causal machine learning, the four strategy-design chapters, then reinforcement learning through live trading.
Or come to the free reader’s guide on July 30, and I will walk you through it.
The book is available from Amazon and Packt. The code is on GitHub, and everything else is at ml4trading.io.
The full chapter map
Every chapter has a guide on the site.
The Process Is Your Edge
The Financial Data Universe
Market Microstructure
Fundamental and Alternative Data
Synthetic Financial Data
Strategy Research Framework
Defining the Learning Task
Financial Feature Engineering
Model-Based Feature Extraction
Text Feature Engineering
The ML Pipeline
Gradient Boosting and Advanced Tabular Models
Deep Learning for Time Series
Latent Factor Models
Causal Machine Learning
Strategy Simulation
Portfolio Construction
Transaction Costs
Risk Management
Strategy Synthesis
Reinforcement Learning for Execution and Hedging
RAG for Financial Research
Knowledge Graphs
Autonomous Agents
Live Trading Systems
MLOps and Governance
The Systematic Edge
My thanks to Antonio Gulli for the generous foreword, to the editors, reviewers, and technical contributors, and to the readers of the second edition, whose questions, issues, and pull requests shaped what this one became.




