Skip to content
ToolsOpen sourceMIT

Qlib

Microsoft's quant research platform for data, models and backtesting

By Microsoft

How does Qlib separate model training from its CSI 300 backtest?

In Microsoft’s Alpha158 example, LightGBM trains on 2008–2014 and uses 2015–2016 for validation. The test window runs from January 1, 2017 through August 1, 2020. If you choose a model after looking at its test returns, those dates have become part of model selection. Keep a later period untouched for a fresh evaluation.

The configuration turns model scores into a portfolio with TopkDropoutStrategy, targeting 50 stocks with n_drop set to 5. It uses the close as the dealing price and specifies fees of 0.05% on purchases and 0.15% on sales, with a minimum fee of 5. To investigate a return difference between two runs, compare these settings, the CSI 300 universe and the data snapshot before attributing it to the model. These figures describe the configuration.

Microsoft’s versioned Alpha158 and LightGBM configuration

Documentation reviewed ·

Workflow and limitations

Qlib supplies components for quantitative research. Its documented qrun workflow connects dataset construction, model training, backtesting and evaluation.

What does a Qlib workflow actually run?

The README demonstrates qrun with a LightGBM workflow configuration after data preparation. This is a configured quantitative pipeline, rather than a conversational trading assistant. The experiment needs its data, model and portfolio settings; installing the package alone does not reproduce a published backtest.

Which version should a reproducibility record identify?

Record the package or source revision, configuration, dataset period and evaluation settings. The reviewed source README explicitly distinguishes unreleased artifact-loading and configuration changes from tagged or PyPI releases. Its migration guidance should therefore be matched to the actual installation, rather than assumed to apply to every released version.

Review scope: We reviewed the pinned README and did not train a model, reproduce a backtest or test an execution integration. Research results do not establish future investment performance.

Reviewed README · 543552324638

Download version record and notes (JSON)

Compare approaches

  • RD-Agent — An adjacent project for automated research and model development.
  • Backtrader — Compare with a framework centered on strategy backtesting.

Live GitHub metrics

Live GitHub data · Nov 27, 2026
Stars
50,628
Stars · 7d
+180
Stars · 30d
+855
30d momentum
+1.7%
Forks
7,980
Open issues
518
Language
Python
Last push
22 days ago

Latest release v0.9.8 on Oct 8, 2026. Repository created Aug 14, 2020.

49.2k49.9k50.6kOct 8Nov 27
Cumulative GitHub stars, Oct 8, 2026 to Nov 27, 2026. Source: InvestingStack daily snapshots.

What it is

Qlib covers the full quant workflow: a fast data store, feature engineering, a model zoo of ML baselines, portfolio construction and backtesting. It is the substrate that RD-Agent's finance scenario builds on and a frequent reference implementation in academic papers.

In the maintainers' words: “Qlib is an AI-oriented Quant investment platform that aims to use AI tech to empower Quant Research, from exploring ideas to implementing productions. Qlib supports diverse ML modeling paradigms, including supervised learning, market dynamics modeling, and RL, and is now equipped with https://github.com/microsoft/RD-Agent to automate R&D process.”

Markets

  • China A-shares
  • US equities

Tags

  • Quant platform
  • Model zoo
  • Backtesting
  • #algorithmic-trading
  • #auto-quant
  • #deep-learning
  • #finance
  • #fintech
  • #investment
  • #machine-learning
  • #paper