diff --git a/vnpy/trader/utility.py b/vnpy/trader/utility.py index bdd3f93d..1843b31f 100644 --- a/vnpy/trader/utility.py +++ b/vnpy/trader/utility.py @@ -253,6 +253,9 @@ class BarGenerator: """ Generate the bar data and call callback immediately. """ + self.bar.datetime = self.bar.datetime.replace( + second=0, microsecond=0 + ) self.on_bar(self.bar) self.bar = None