qlib icon indicating copy to clipboard operation
qlib copied to clipboard

detailed_workflow.ipyb collector.py not working

Open vishalkhialani opened this issue 1 year ago • 3 comments

❓ Questions and Help

Thank you for making this tool. I am learning the ropes and was going through [\examples\tutorial\detailed_workflow.ipynb](https://github.com/microsoft/qlib/blob/main/examples/tutorial/detailed_workflow.ipynb)

I am stuck at at cell where it is suppose to download extra data


if not p.exists():
    !cd ../../scripts/data_collector/pit/ && pip install -r requirements.txt
    !cd ../../scripts/data_collector/pit/ && 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).*"
    !cd ../../scripts/data_collector/pit/ && python collector.py normalize_data --interval quarterly --source_dir ~/.qlib/stock_data/source/pit --normalize_dir ~/.qlib/stock_data/source/pit_normalized
    !cd ../../scripts/ && python dump_pit.py dump --csv_path ~/.qlib/stock_data/source/pit_normalized --qlib_dir ~/.qlib/qlib_data/cn_data --interval quarterly

I just stays at stalls for a couple hrs and does not download the data. You can see the output here -
https://gist.github.com/vishalkhialani/1b15eb9a50511f67e05cf2d3d7835f75

I am on win11 and tried it on linux too but it did not help. I tried to debug it but its taking very long as I am new to the tool. Please can someone guide me on this.

vishalkhialani avatar Dec 26 '24 03:12 vishalkhialani

I spent some time and I have narrowed down the issue to be with

\scripts\data_collector\utils.py

resp = requests.get(HS_SYMBOLS_URL.format(s_type=_k), timeout=None)

As http://app.finance.ifeng.com/hq/list.php?type=stock_a&class=ha is giving a 404.

The API has been either deprecated or moved. I can't fix this as this will need the authors to find an alternative endpoint or the updated one.

vishalkhialani avatar Dec 26 '24 10:12 vishalkhialani

Hi, @vishalkhialani , This issue has been resolved in PR 1758, please pull the latest code and retry.

SunsetWolf avatar Dec 30 '24 13:12 SunsetWolf

thanks @SunsetWolf I thought I had the latest pull. I will check it later.

vishalkhialani avatar Jan 11 '25 04:01 vishalkhialani