mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-09 13:58:25 +08:00
BUG: for issue #178, checking the order status instead of relying on the open amount
This commit is contained in:
@@ -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