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.
This commit is contained in:
Dale Jung
2015-02-27 08:19:41 -05:00
parent 94d25a54c6
commit 98ee8efe3d
+1
View File
@@ -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,