# Qlib

Microsoft's ML factor-research pipeline. The data its CLI downloads stops in late 2020.

**Best for:** quants who want factor libraries, model training and a cross-sectional backtest in one Python pipeline; not for someone who needs current data out of the box or a live broker connection.

*https://stockmarketstack.com/tools/qlib · Backtesting Frameworks & Algo Trading Libraries*

## Facts

### At a glance

| Field | Value |
| --- | --- |
| Vendor | Microsoft |
| Category | Backtesting Frameworks & Algo Trading Libraries |
| Job | research |
| Website | https://github.com/microsoft/qlib |
| Pricing model | open-source |
| Free tier | true |
| Open source | true |
| Licence | MIT |
| Self-hosted | true |
| Tested hands-on | no |
| Claimed by vendor | no |
| Last updated | 2026-10-07 |

### Coverage

| Field | Value |
| --- | --- |
| Asset classes | stocks, indices |
| Markets | us, asia, latam |
| Works outside the US | true |
| Data latency | none |
| Platforms | library, cli |
| AI features | research |

### Interfaces

| Field | Value |
| --- | --- |
| API | false |
| Webhooks | false |
| Scripting | Python |
| Python | true |
| Spreadsheet add-in | false |
| MCP server | false |
| Export | none |

### Capabilities

Yes: backtesting

No: charting, screening, scanning, automation, live_trading, paper_trading, portfolio_tracking, broker_import, tax_reporting, alerts, news, options_analysis

*Verified: pricing 2026-10-07; capabilities 2026-10-07; coverage 2026-10-07.*

## What it is

Qlib is a research pipeline for machine-learning stock selection. You describe a dataset, a
model and a strategy in one YAML file, and `qrun` builds features, trains, predicts, backtests
and writes an evaluation report. Its unit is the cross-section rather than one strategy on
one ticker. A model scores every stock in a universe such as the CSI 300 or the S&P 500 each day.
A top-k strategy then rebalances into the best-scored names. The report shows information
coefficient, grouped returns and excess return over a benchmark, with and without costs.

What it has that most backtesters lack is the layer before the strategy. It has its own binary
data store and an expression language for features (`Ref($close, 1)`, `Mean($close, 3)`). It
ships two ready-made factor sets, Alpha158 and Alpha360, and benchmark configs for 26 models,
from LightGBM and XGBoost to LSTM, Transformer, TabNet and Microsoft's own research models such
as HIST and DoubleEnsemble. It also has a point-in-time store for quarterly fundamentals and a
reinforcement-learning framework for order execution.

Microsoft Research publishes it under the MIT licence. RD-Agent, its LLM tool for proposing
factors and tuning models, is a separate repository and is not part of this package.

## Pricing

Free and MIT-licensed, with nothing to buy. The cost is data and compute: the deep-learning
models in the benchmark zoo want a GPU, while LightGBM on Alpha158 runs on a laptop.

## Data & coverage

The engine knows three regions: China, with 100-share lots and a ±9.5% limit-move check; the
US, with single shares and no limit check; and Taiwan, with 1,000-share lots. Yahoo collector
scripts also build daily and one-minute bars for India and Brazil. Each region's universes are
index-constituent lists: CSI 100, 300 and 500 for China, and the S&P 500 and Nasdaq-100 for the US.

The datasets the CLI downloads are frozen in 2020 (see the FAQ). The README says that the
"official dataset is disabled temporarily". Instead it points to `chenditc/investment_data`, a
community project that publishes a fresh China A-share bundle in Qlib's format every day. Its
latest release was dated 7 October 2026. There is no equivalent for the US. For that market you
run the Yahoo collector yourself, and Yahoo's history leaves out delisted names, which builds
survivorship bias into any backtest on it. Qlib's own crowd-source page says the same.

A crypto collector exists, but its README says that the dataset supports data retrieval only and
not backtesting, because it lacks OHLC bars. A mutual-fund collector reads Chinese funds.

## Limitations

- The bundled data ends in 2020, and the official download has been "temporarily" disabled
  since at least May 2024, when the archives were last refreshed.
- There is no live trading, no paper trading and no broker adapter. The exchange is a simulator.
- The defaults are China-shaped. All 56 benchmark configs target CSI 300 or CSI 500 and carry
  A-share costs: 5 bps to open, 15 bps to close and a minimum fee of 5. A US run means
  rewriting most of the config, not just changing the region flag.
- The release cadence has stalled: 0.9.7 in August 2025, while the hosted docs already describe
  a 0.9.8 development build that has not been released.
- No wheels for Python 3.13 or later, and LightGBM needs `brew install libomp` on Apple Silicon.
- The MIT licence covers the code, not the bars the Yahoo collector fetches, and training a model
  on them is a question for Yahoo's terms. [Can you train a model on licensed market data?](https://stockmarketstack.com/guides/training-models-on-market-data)
  maps it.

## Alternatives

[Zipline-reloaded](https://stockmarketstack.com/tools/zipline-reloaded)'s Pipeline API is the nearest thing to Qlib's factor
layer, but it has no model zoo. [VectorBT](https://stockmarketstack.com/tools/vectorbt) is the fast way to sweep rules you
already have. [QuantConnect](https://stockmarketstack.com/tools/quantconnect) solves the US data problem and connects to a
broker, at the price of running on its platform. [NautilusTrader](https://stockmarketstack.com/tools/nautilus-trader) is the
choice when the goal is execution rather than research. [FinRL](https://stockmarketstack.com/tools/finrl) is the
reinforcement-learning counterpart from the AI4Finance Foundation, with gym-style environments and
RL agents in place of supervised factor models. [PyBroker](https://stockmarketstack.com/tools/pybroker) backtests a model you
trained yourself on each symbol's data, retrained walk-forward, rather than a cross-sectional ranker.
[Kronos](https://stockmarketstack.com/tools/kronos), an open-weights model pre-trained on OHLCV bars, runs its fine-tuning demo
and its only backtest on Qlib's engine, a top-k backtest over the fine-tuned model's output.

## FAQ

### How current is the data Qlib downloads for you?

Not current. On 7 October 2026 the archives behind `get_data.py qlib_data` ended on 25 September 2020 for China and 10 November 2020 for the US, read from each archive's own trading calendar. They are hosted on a maintainer's personal GitHub releases, last updated in May 2024. Current China data comes from a community project; current US data is yours to collect.

### Is `pip install qlib` the right install?

No. The `qlib` name on PyPI belongs to an unrelated 2018 package — version 0.0.2.dev20 from a "Q Engineering Dev Team". Microsoft's project is `pyqlib`, which is what the README names. Its last release, 0.9.7, has wheels for Python 3.8 to 3.12 only, so a newer interpreter builds from source.

### Can Qlib trade a live account?

No. The executor fills orders against its own simulated exchange, and there is no broker adapter anywhere in the package. The "online serving" component rolls models forward and writes fresh predictions; turning those into orders is your code.

### Is it still maintained?

Slowly. The last release is 0.9.7, tagged 15 August 2025. The last change to `main` that was not CI was on 23 July 2026, and the two commits after it, on 16 September 2026, are CI fixes. The repository is not archived. On 7 October 2026 it had 306 open issues and 182 open pull requests.

## Also worth comparing

- [Kronos](https://stockmarketstack.com/tools/kronos.md) — Open-weights transformer pre-trained on OHLCV bars. The training corpus is not released.
- [FinGPT](https://stockmarketstack.com/tools/fingpt.md) — Financial LLM adapters, instruction datasets and training notebooks, all MIT.
- [FinRL](https://stockmarketstack.com/tools/finrl.md) — Gym-style market environments and deep-RL agents for trading research, MIT-licensed.
- [Backtrader](https://stockmarketstack.com/tools/backtrader.md) — An event-driven Python backtester with 122 indicators, frozen since April 2023.
- [ib_async](https://stockmarketstack.com/tools/ib-async.md) — The community continuation of ib_insync — same API, new maintainers, TWS still required.
- [Backtesting.py](https://stockmarketstack.com/tools/backtesting-py.md) — A single-instrument Python backtester — one OHLC series, one strategy, no live trading.
