Improve order handling

This commit is contained in:
Matthias
2020-08-13 15:54:36 +02:00
parent 0af9e913d4
commit ebd755e36a
2 changed files with 15 additions and 5 deletions

View File

@@ -151,9 +151,12 @@ class Order(_DECL_BASE):
"""
"""
filtered_orders = [o for o in orders if o.order_id == order['id']]
oobj = filtered_orders[0] if filtered_orders else None
oobj.update_from_ccxt_object(order)
oobj.order_update_date = datetime.now()
if filtered_orders:
oobj = filtered_orders[0]
oobj.update_from_ccxt_object(order)
oobj.order_update_date = datetime.now()
else:
logger.warning(f"Did not find order for {order['id']}.")
@staticmethod
def parse_from_ccxt_object(order: Dict[str, Any], side: str) -> 'Order':