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

backfill data not filled properly due to wrong timezone info #78

Closed
shlomiku opened this issue Jun 26, 2020 · 0 comments · Fixed by #79
Closed

backfill data not filled properly due to wrong timezone info #78

shlomiku opened this issue Jun 26, 2020 · 0 comments · Fixed by #79

Comments

@shlomiku
Copy link
Contributor

when doing a backfill we get the data from alpaca/polygon at the beginning of the execution
then we change the tz info to match the NY tz
due to day light savings, we get an offset by M minutes (changes with the day and year)
how does it influence us?
e.g we need minute data from X to Y, but we get Y - M
M is the offset
so, backtrader doesn't "think" it has all the data it requires to start

we change replace() to localize() which takes care of the issue.
we could see the difference here:
image

you can read more about it here:
https://stackoverflow.com/a/1592837/2739124
https://stackoverflow.com/questions/35462876/python-pytz-timezone-function-returns-a-timezone-that-is-off-by-9-minutes
http://pytz.sourceforge.net/

@shlomiku shlomiku linked a pull request Jun 26, 2020 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant