From 98ee8efe3db6a5cf3edb6b44b675bdb3276a750b Mon Sep 17 00:00:00 2001 From: Dale Jung Date: Fri, 27 Feb 2015 08:19:41 -0500 Subject: [PATCH] BUG: Added sorting back to orders. This isn't a functional bug so much as it is a backwards compat. Without sorting the orders are filled by order date. With sorting the orders are moved to back of queue after partil fills. If all orders are fully filled, there is no deviation. Also there is no portfolio difference as this is about assigning fills to equivalent orders. --- zipline/finance/blotter.py | 1 + 1 file changed, 1 insertion(+) diff --git a/zipline/finance/blotter.py b/zipline/finance/blotter.py index 807e8495..00501bcd 100644 --- a/zipline/finance/blotter.py +++ b/zipline/finance/blotter.py @@ -200,6 +200,7 @@ class Blotter(object): return orders = self.open_orders[trade_event.sid] + orders.sort(key=lambda o: o.dt) # Only use orders for the current day or before current_orders = filter( lambda o: o.dt <= trade_event.dt,