-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
How to query the data of the historical reporting period when using PIT data? #988
Comments
@Chaoyingz If I want to refer to historical data , I'll use operators like Can you give us more details about the scenario you encountered? |
@you-n-g for example, I want to use the current time as the observation point to query the data with the reporting period of 201901. What should I do? |
so your stock pool will only available after 201901? I think we can implement a new operator to achieve this goal. |
The observation point in this scenario is always the current time. I only care about which stocks have financial data that meet certain criteria based on the current time. if the conditions are met, this stock will enter the stock pool. >>> import qlib
>>> from qlib.data import D
>>> qlib.init()
>>> instruments = ["sh600519", "sz000858"]
>>> fields = ["PRef($$roewa_q, 201901)", "PRef($$yoyni_q, 201902)"]
>>> D.features(instruments, fields, start_time="2022-03-15", end_time="2022-03-15", freq="day")
PRef($$roewa_q, 201901) PRef($$yoyni_q, 201902)
instrument datetime
sh600519 2022-03-15 1.000000 1.305041
sh600519 2022-03-15 2.000000 2.305041 |
I submitted this PR to resolve the issue #1000. |
* Add PRef operator (microsoft#988) * Fix type annotations * Add test_pref_operator test case field * Add note to PITProvider * Add period parameter comment
🌟 Feature Description
How to query the data of the historical reporting period when using PIT data?
Is there a way to achieve this effect?
If possible, use a period instead of datetime for indexing, like this:
I am going to write a
PITPeriodProvider
to query the stored PIT data by referring toArcticFeatureProvider
. Is there a better way?Motivation
Alternatives
Additional Notes
The text was updated successfully, but these errors were encountered: