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

Discrepancy Between yf.download & yf.Ticker().history() #1036

Closed
keg5038 opened this issue Jul 18, 2022 · 4 comments
Closed

Discrepancy Between yf.download & yf.Ticker().history() #1036

keg5038 opened this issue Jul 18, 2022 · 4 comments

Comments

@keg5038
Copy link

keg5038 commented Jul 18, 2022

I am looking at Wheat Futures data (ticker=ZWZ22.CBT) & getting a discrepancy when running the following:

yf.Ticker("ZWZ22.CBT").history(interval="1d",period="10d").tail(30)

Returns data including today's trading day 2022-07-18.

Comparing this to:
yf.download('ZWZ22.CBT')
Which doesn't include 2022-07-18. The last day is 2022-07-15.

Why is there this discrepancy?

@ValueRaider
Copy link
Collaborator

yfinance doesn't handle timezones well, so often returned data is off by one day. Except when period is specified, then Yahoo handles the timezones.

I have a branch that should fix this but needs volunteers to test before I merge. See #954 (comment)

@keg5038
Copy link
Author

keg5038 commented Jul 19, 2022

Thank you @ValueRaider for your quick response! I did a bit more testing & it looks like something to do with the start being specified as well:

yf.download("ZWZ22.CBT ZWU22.CBT", interval="1d",period='10d')
This shows correctly, including 2022-07-19 data

The same command with 'start' included:
yf.download("ZWZ22.CBT ZWU22.CBT",start='2022-07-01', interval="1d",period='10d')
Information is the same as above, but does not include 2022-07-19 data.

I am not much of a programmer & have never contributed to open source but would be willing to try to help test if that would be helpful. Any suggestions on how to help?

@ValueRaider
Copy link
Collaborator

ValueRaider commented Jul 19, 2022

Click the link. Then just use it, provide feedback.

@ValueRaider
Copy link
Collaborator

This should be solved in recent releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants