BUG: for issue #178, checking the order status instead of relying on the open amount

This commit is contained in:
Frederic Fortier
2018-01-29 19:20:34 -05:00
parent 7f021acb2e
commit 5c236a65f7
+1 -1
View File
@@ -214,7 +214,7 @@ class ExchangeBlotter(Blotter):
# that this is safer until we have a robust way to track
# the trades already processed by the algo. We can't loose
# them if the algo shuts down.
if transactions and order.open_amount == 0:
if transactions and order.status == ORDER_STATUS.FILLED:
avg_price = np.average(
a=[t.price for t in transactions],
weights=[t.amount for t in transactions],