Qlib (Microsoft) quantitative research workflow skill/playbook. Use this to run factor-style backtests, model training, and evaluation loops. Focus: turning hypotheses into measurable A/B results (signals → backtest → report).
Upstream:
We use Qlib for mathy, disciplined iteration:
For alpha-engine, Qlib is a reference architecture for:
Qlib is Python-based. Recommended: conda env.
If you don’t have Python/conda installed:
conda create -n qlib python=3.11 -y
conda activate qlib
# Mac tip (especially Apple Silicon):
brew install libomp
pip install -U pip
pip install pyqlib
Or dev install:
git clone https://github.com/microsoft/qlib.git
cd qlib
pip install -e .
Qlib needs a dataset. The upstream README notes the official dataset is sometimes disabled; community releases exist.
Example (from upstream README):
wget https://github.com/chenditc/investment_data/releases/latest/download/qlib_bin.tar.gz
mkdir -p ~/.qlib/qlib_data/cn_data
tar -zxvf qlib_bin.tar.gz -C ~/.qlib/qlib_data/cn_data --strip-components=1
rm -f qlib_bin.tar.gz
Try the code-based workflow example:
We will not switch alpha-engine to Qlib. Instead we’ll import Qlib discipline:
Factorize our entry score
Offline evaluation loop
Export artifacts