You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Guofu Li 0f18a40b56
init
3 years ago
..
README.md init 3 years ago
collector.py init 3 years ago
requirements.txt init 3 years ago

README.md

Collect Point-in-Time Data

Please pay ATTENTION that the data is collected from baostock and the data might not be perfect. We recommend users to prepare their own data if they have high-quality dataset. For more information, users can refer to the related document

Requirements

pip install -r requirements.txt

Collector Data

Download Quarterly CN Data

cd qlib/scripts/data_collector/pit/
# download from baostock.com
python collector.py download_data --source_dir ~/.qlib/stock_data/source/pit --start 2000-01-01 --end 2020-01-01 --interval quarterly

Downloading all data from the stock is very time consuming. If you just want run a quick test on a few stocks, you can run the command below

python collector.py download_data --source_dir ~/.qlib/stock_data/source/pit --start 2000-01-01 --end 2020-01-01 --interval quarterly --symbol_regex "^(600519|000725).*"

Normalize Data

python collector.py normalize_data --interval quarterly --source_dir ~/.qlib/stock_data/source/pit --normalize_dir ~/.qlib/stock_data/source/pit_normalized

Dump Data into PIT Format

cd qlib/scripts
python dump_pit.py dump --csv_path ~/.qlib/stock_data/source/pit_normalized --qlib_dir ~/.qlib/qlib_data/cn_data --interval quarterly