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

Do not load bar with the same timestamp as the latest bar; #464

Open
wants to merge 1 commit 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
4 changes: 2 additions & 2 deletions backtrader/feeds/ibdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ def _load_rtbar(self, rtbar, hist=False):
# The historical data has the same data but with 'date' instead of
# 'time' for datetime
dt = date2num(rtbar.time if not hist else rtbar.date)
if dt < self.lines.datetime[-1] and not self.p.latethrough:
if dt <= self.lines.datetime[-1] and not self.p.latethrough:
return False # cannot deliver earlier than already delivered

self.lines.datetime[0] = dt
Expand All @@ -687,7 +687,7 @@ def _load_rtvolume(self, rtvol):
# contains open/high/low/close/volume prices
# Datetime transformation
dt = date2num(rtvol.datetime)
if dt < self.lines.datetime[-1] and not self.p.latethrough:
if dt <= self.lines.datetime[-1] and not self.p.latethrough:
return False # cannot deliver earlier than already delivered

self.lines.datetime[0] = dt
Expand Down