
Mission 4 of 5
Home Hedge Fund, Module 4: Qlib, Microsoft's AI quant lab
Qlib is the research platform Microsoft built for AI quant investing: market data, 158 ready-made alpha factors, a zoo of models from LightGBM to Transformers, and backtests that report return, information ratio and drawdown. In this module you'll load years of data, train a model and backtest a full strategy with one command, learn to read every number it prints, then swap models, change the stock universe and test on recent years.
What you'll do
- The know-how to read IC, annualised return, information ratio and max drawdown
- Your own experiments: a different model, a different universe and a recent-years test
- Module 1 done: Miniconda and Git installed
- Python 3.8 to 3.12 (conda installs it for you)
- About 5 GB of free disk space and 8 GB of RAM (16 GB is more comfortable)
- About 70 minutes, much of it waiting for data and training
Your progress0/8
What Qlib does, and what you'll use it for
Know the quant workflow Qlib automates, and the questions it answers.
Quant funds don't guess. They turn ideas into numbers, train models to find patterns, and test them on years of history before a penny moves. Qlib packs that whole pipeline into one open-source platform from Microsoft.
- Data: a fast local store of daily (and 1-minute) market data, with tools to check its health and keep it updated.
- Alpha factors: ready-made feature sets.
Alpha158gives every stock 158 signals built from price and volume;Alpha360gives 360. - Models: a model zoo of more than 20 published approaches: LightGBM, XGBoost, CatBoost, LSTM, GRU, Transformer, TabNet, HIST and more.
- Backtests and reports: a strategy picks stocks from the model's scores, trades them with realistic costs and reports the results.
qrun runs the lotOne config file describes data, model, strategy and backtest, and one command runs it from start to finish.
What people use it for
- Does a model actually find signal? The IC numbers tell you in one line.
- Model bake-off: LightGBM against XGBoost against a neural network, same data, same backtest, scored the same way.
- Big stocks or small? Run the same strategy on the CSI 300 and the CSI 500 and see where the edge lives.
- Concentrated or spread out? Hold the top 30 or the top 50 and see what it does to return and drawdown.