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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ref ops creating an issue with non existing instruments #64

Closed
krsnad opened this issue Nov 6, 2020 · 3 comments
Closed

Ref ops creating an issue with non existing instruments #64

krsnad opened this issue Nov 6, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@krsnad
Copy link

krsnad commented Nov 6, 2020

馃悰 Bug Description

querying 'Ref' fields for non existing instruments fails

To Reproduce

Steps to reproduce the behavior:

D.features(tickers, fields, start_time=start_time, end_time=end_time, freq=freq)
passing non existing instruments to the above tickers will fail, where fields = ['$close/Ref($close, 1)-1']

Expected Behavior

should ideally return an empty data

Screenshot

image

Environment

Note: One could run python scripts/collect_info.py under the qlib directory to get the following information.

  • Qlib version:
  • Python version:
  • OS (Windows, Linux, MacOS):
  • Commit number (optional, please provide it if you are using the dev version):

Additional Notes

@krsnad krsnad added the bug Something isn't working label Nov 6, 2020
@you-n-g
Copy link
Collaborator

you-n-g commented Nov 6, 2020

Hi, @krsnad
I can't reproduce your bug with following code.

import qlib
from qlib.data import D
qlib.init()

instruments = ['xixi']
fields = ['$close/Ref($close, 1)-1']
data = D.features(instruments, fields, start_time='2010-01-01', end_time='2017-12-31', freq='day')
print(data)

Can you give us more details?
Thanks

@krsnad
Copy link
Author

krsnad commented Nov 6, 2020

Hi,
in the above example, is xixi a valid instrument?

@krsnad
Copy link
Author

krsnad commented Nov 6, 2020

Sorry about this these are changes specific to my fork. Closing this issue

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

No branches or pull requests

2 participants