使用 pip 安装
用户可以按照以下命令通过 pip 轻松安装 Qlib。
pip install pyqlib
注意:pip 将安装最新的稳定 qlib。但是,qlib 的主要分支正在积极开发中。如果您想在主分支中测试最新的脚本或功能。请使用以下方法安装 qlib。
自动量化研究工作流程
Qlib 提供了一个名为 qrun 的工具来自动运行整个工作流程(包括构建数据集、训练模型、回测和评估)。您可以根据以下步骤启动自动量化研究工作流程并进行图形报告分析:
Quant Research Workflow: Run qrun with lightgbm workflow config (workflow_config_lightgbm_Alpha158.yaml as following.
- cd examples # Avoid running program under the directory contains `qlib`
- qrun benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
如果用户想qrun在调试模式下使用,请使用以下命令:
python -m pdb qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
结果qrun如下,有关结果的详细信息,请参阅日内交易。
'The following are analysis results of the excess return without cost.'
risk
mean 0.000708
std 0.005626
annualized_return 0.178316
information_ratio 1.996555
max_drawdown -0.081806
'The following are analysis results of the excess return with cost.'
risk
mean 0.000512
std 0.005626
annualized_return 0.128982
information_ratio 1.444287
max_drawdown -0.091078
以下是详细的文档qrun和工作流程。
图形报告分析:运行examples/workflow_by_code.ipynb以jupyter notebook获取图形报告
预测信号(模型预测)分析