Backtest a machine-learning-driven trading strategy on historical stock prices using the Zipline engine
Train an NLP model on SEC filings or earnings call transcripts to predict stock price movements
Generate synthetic time-series market data using GANs for strategy stress testing
Build a deep reinforcement learning trading agent using the included end-to-end notebook examples
Requires a custom Zipline fork and financial data downloads before the trading strategy notebooks can run.
This repository is the companion code for the book "Machine Learning for Algorithmic Trading, 2nd edition", a roughly 800-page, 23-chapter guide on using machine learning to design trading strategies for financial markets. The repo's role is to make the book runnable: it contains over 150 Jupyter notebooks that show how to source market and alternative data, engineer features, train ML models, turn predictions into trading signals, and backtest the resulting strategy on historical data. The material follows what the book calls the ML4T workflow: collecting data, extracting features, training and tuning an ML model, designing a strategy on top of its predictions, and simulating it on past prices using a backtesting engine. Coverage spans techniques from linear regression through unsupervised learning, CNNs and RNNs applied to market and alternative data, generative adversarial networks for synthetic time-series data, and deep reinforcement learning for a trading agent. Alternative data sources include SEC filings, earnings call transcripts, and satellite images. A customised version of the Zipline library is provided to plug ML predictions into the backtest, and an appendix documents over 100 alpha factors. Someone would use this if they are a quantitative-trading practitioner, finance student, or data scientist who wants a worked-example path from raw data to a backtested ML-driven strategy. The code is Python in Jupyter notebooks and relies on standard data-science libraries including pandas and TensorFlow. A companion website at ml4trading.io and a community at exchange.ml4trading.io are linked from the README. The full README is longer than what was provided.
← stefan-jansen on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.