1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-06-06 05:51:17 +08:00
Files
qlib/scripts
2020-11-20 10:59:37 +08:00
..
2020-11-19 10:36:14 +08:00
2020-11-20 10:59:37 +08:00
2020-11-19 16:20:03 +08:00
2020-11-20 10:59:37 +08:00
2020-11-19 16:20:03 +08:00

Download Qlib Data

Download CN Data

python get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn

Downlaod US Data

The US stock code contains 'PRN', and the directory cannot be created on Windows system: https://superuser.com/questions/613313/why-cant-we-make-con-prn-null-folder-in-windows

python get_data.py qlib_data --target_dir ~/.qlib/qlib_data/us_data --region us

Download CN Simple Data

python get_data.py qlib_data --name qlib_data_simple --target_dir ~/.qlib/qlib_data/cn_data --region cn

Help

python get_data.py qlib_data --help

Using in Qlib

For more information: https://qlib.readthedocs.io/en/latest/start/initialization.html

US data

import qlib
from qlib.config import REG_US
provider_uri = "~/.qlib/qlib_data/us_data"  # target_dir
qlib.init(provider_uri=provider_uri, region=REG_US)

CN data

import qlib
from qlib.config import REG_CN
provider_uri = "~/.qlib/qlib_data/cn_data"  # target_dir
qlib.init(provider_uri=provider_uri, region=REG_CN)