mirror of
https://github.com/microsoft/qlib.git
synced 2026-06-06 05:51:17 +08:00
* Fix high-freq data name from `yahoo_cn_1min` to `cn_data_1min`
* re-format example data names using `qlib_{region}_{feq}`, e.g. qlib_cn_1d
* re-format example data names using `{region}_{feq}`, e.g. us_1d and cn_1min
* keep using for 1day data, and change 1min data to
69 lines
1.5 KiB
Markdown
69 lines
1.5 KiB
Markdown
|
|
- [Download Qlib Data](#Download-Qlib-Data)
|
|
- [Download CN Data](#Download-CN-Data)
|
|
- [Download US Data](#Download-US-Data)
|
|
- [Download CN Simple Data](#Download-CN-Simple-Data)
|
|
- [Help](#Help)
|
|
- [Using in Qlib](#Using-in-Qlib)
|
|
- [US data](#US-data)
|
|
- [CN data](#CN-data)
|
|
|
|
|
|
## Download Qlib Data
|
|
|
|
|
|
### Download CN Data
|
|
|
|
```bash
|
|
# 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
|
|
|
|
|
|
```bash
|
|
python get_data.py qlib_data --target_dir ~/.qlib/qlib_data/us_data --region us
|
|
```
|
|
|
|
### Download CN Simple Data
|
|
|
|
```bash
|
|
python get_data.py qlib_data --name qlib_data_simple --target_dir ~/.qlib/qlib_data/cn_data --region cn
|
|
```
|
|
|
|
### Help
|
|
|
|
```bash
|
|
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](#Download-US-Data)
|
|
|
|
```python
|
|
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](#Download-CN-Data)
|
|
|
|
```python
|
|
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)
|
|
```
|