mirror of
https://github.com/wassname/catalyst.git
synced 2026-10-29 13:00:42 +08:00
BUG: for issue #178, checking the order status instead of relying on the open amount
This commit is contained in:
1 parent
7f021acb2e
commit
5c236a65f7
1 file changed
+1
-1
@@ -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],
|
||||
|
||||
Reference in new issue
Block a user