Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix csi500 end date issue #1373

Merged
merged 1 commit into from
Nov 28, 2022
Merged

Conversation

qianyun210603
Copy link
Contributor

Description

Use today instead of returned date from baostock as the end date of csi500 instruments.

Motivation and Context

The "end_date" of get_new_companies should be today instead of the returned date of baostock.query_zz500_stocks, as the latter is the latest update date before the date given in parameter, it is not the last effective date thus does not change with the data date.
As a result, running the current version (with bug) today returns csi500 instrument file as below

SH600006	2013-06-25	2022-08-01
SH600008	2018-12-11	2022-08-01
SH600021	2018-06-05	2022-08-01
...

(to verify, running qlib\scripts\data_collector\cn_index>python collector.py --qlib_dir E:\fake1ddir --index-name=CSI500)
and any test with stock population of csi500 ends at 2022-08-01.

This pull request fixes the bug.

How Has This Been Tested?

  • Pass the test by running: pytest qlib/tests/test_all_pipeline.py under upper directory of qlib.
  • If you are adding a new feature, test on your own test scripts.

Screenshots of Test Results (if appropriate):

  1. Pipeline test:
  2. Your own tests:
    running the collector generates correct instrument population file
SH600006	2013-06-25	2022-11-22
SH600008	2018-12-11	2022-11-22
SH600021	2018-06-05	2022-11-22
SH600022	2016-12-06	2022-11-22
SH600026	2013-06-25	2022-11-22
SH600027	2021-06-16	2022-11-22

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

@you-n-g
Copy link
Collaborator

you-n-g commented Nov 28, 2022

Thanks so much!

@you-n-g you-n-g merged commit 4f5ae4d into microsoft:main Nov 28, 2022
@qianyun210603 qianyun210603 deleted the csi500_enddate branch December 3, 2022 03:49
@you-n-g you-n-g added the bug Something isn't working label Dec 9, 2022
qianyun210603 added a commit to qianyun210603/qlib that referenced this pull request Mar 23, 2023
qianyun210603 added a commit to qianyun210603/qlib that referenced this pull request Mar 23, 2023
qianyun210603 added a commit to qianyun210603/qlib that referenced this pull request Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants