diff --git a/zipline/algorithm.py b/zipline/algorithm.py index 3b5cb2e4..f6c7ff41 100644 --- a/zipline/algorithm.py +++ b/zipline/algorithm.py @@ -156,8 +156,6 @@ class TradingAlgorithm(object): Any asset identifiers that are not provided in the asset_metadata, but will be traded by this TradingAlgorithm """ - self.datetime = None - self.sources = [] # List of trading controls to be used to validate orders. @@ -208,6 +206,9 @@ class TradingAlgorithm(object): if not self.blotter: self.blotter = Blotter() + # Set the dt initally to the period start by forcing it to change + self.on_dt_changed(self.sim_params.period_start) + self.portfolio_needs_update = True self.account_needs_update = True self.performance_needs_update = True