From 15dd1f9c0e3e16bcbe543b67657259c25976c7ce Mon Sep 17 00:00:00 2001 From: Richard Frank Date: Fri, 10 Jan 2014 13:13:30 -0500 Subject: [PATCH] ENH: Always process new orders Allows for updating of new_orders even when handle_data isn't called --- zipline/gens/tradesimulation.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/zipline/gens/tradesimulation.py b/zipline/gens/tradesimulation.py index 8d7c6132..715ec468 100644 --- a/zipline/gens/tradesimulation.py +++ b/zipline/gens/tradesimulation.py @@ -155,13 +155,13 @@ class AlgorithmSimulator(object): self.algo.handle_data(self.current_data) updated = False - # run orders placed in the algorithm call - # above through perf tracker before emitting - # the perf packet, so that the perf includes - # placed orders - for order in self.algo.blotter.new_orders: - self.algo.perf_tracker.process_event(order) - self.algo.blotter.new_orders = [] + # run orders placed in the algorithm call + # above through perf tracker before emitting + # the perf packet, so that the perf includes + # placed orders + for order in self.algo.blotter.new_orders: + self.algo.perf_tracker.process_event(order) + self.algo.blotter.new_orders = [] # If we are instantly filling we execute orders # in this iteration rather than the next.