From 5c236a65f7ed0906bfc29cf2a08c920831327f79 Mon Sep 17 00:00:00 2001 From: Frederic Fortier Date: Mon, 29 Jan 2018 19:20:34 -0500 Subject: [PATCH] BUG: for issue #178, checking the order status instead of relying on the open amount --- catalyst/exchange/exchange_blotter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst/exchange/exchange_blotter.py b/catalyst/exchange/exchange_blotter.py index d4957e31..6ded5adf 100644 --- a/catalyst/exchange/exchange_blotter.py +++ b/catalyst/exchange/exchange_blotter.py @@ -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],