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

Resolves resampling issues due to timezone differences. #467

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions backtrader/resamplerfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class DTFaker(object):

def __init__(self, data, forcedata=None):
self.data = data
self._tz = data._tz

# Aliases
self.datetime = self
Expand Down Expand Up @@ -271,8 +272,8 @@ def _barover_subdays(self, data):
return False

# Get time objects for the comparisons - in utc-like format
tm = num2date(self.bar.datetime).time()
bartm = num2date(data.datetime[0]).time()
tm = num2date(self.bar.datetime, tz=data._tz).time()
bartm = num2date(data.datetime[0], tz=data._tz).time()

point, _ = self._gettmpoint(tm)
barpoint, _ = self._gettmpoint(bartm)
Expand Down