Get Started
Home Hedge Fund

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.

70 minAdvancedFreeStep 1 free

What you'll do

Qlib installed in its own Python environment
Years of daily market data loaded on your computer, health-checked
A LightGBM model trained on 158 alpha factors and backtested end to end
  • 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
Before you start
  • 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
Runs onWindowsMacLinux
CostFree. No API keys: it runs on your own computer with free public data
Tested7 Nov 2026pyqlib 0.9.7, Python 3.12, mlflow 3.12, community cn_data release of 4 Nov 2026, Windows 11 (22 cores). Data download, health check and the LightGBM and XGBoost Alpha158 workflows ran end to end, about 20 minutes each
01/08What Qlib does, and what you'll use it for0 done
STEP 01 of 08~4 min

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. Alpha158 gives every stock 158 signals built from price and volume; Alpha360 gives 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.
Warning
Not financial advice. Start in paper/dry-run mode.
Checkpoint
You can name the four stages: data, factors, model, backtest.
Stuck? Ask the community
Next mission · Home Hedge FundHome Hedge Fund, Module 5: Freqtrade, a crypto trading bot that runs 24/7
→