1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-06-06 05:51:17 +08:00
Files
qlib/scripts
YQ Tsui cc01812c62 Fix typos and grammar errors in docstrings and comments (#1366)
* fix gramma error in doc strings

* fix typos in exchange.py

* fix typos and gramma errors

* fix typo and rename function param to avoid shading python keyword

* remove redundant parathesis; pass kwargs to parent class

* fix pyblack

* further correction

* assign -> be assigned to
2022-11-20 14:15:59 +08:00
..
2021-01-18 19:37:24 +08:00
2022-11-04 21:15:23 +08:00
2021-01-26 16:06:38 +08:00
2022-07-22 09:24:58 +08:00

Download Qlib Data

Download CN Data

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

# 1min  data (Optional for running non-high-frequency strategies)
python get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data_1min --region cn --interval 1min

Download US Data

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

Need to download data first: Download 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

Need to download data first: Download CN Data

import qlib
from qlib.constant import REG_CN

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

Use Crowd Sourced Data

The is also a crowd sourced version of qlib data: https://github.com/chenditc/investment_data/releases

wget https://github.com/chenditc/investment_data/releases/download/20220720/qlib_bin.tar.gz
tar -zxvf qlib_bin.tar.gz -C ~/.qlib/qlib_data/cn_data --strip-components=2