Add open_order_updater

This commit is contained in:
Matthias
2020-08-13 17:18:56 +02:00
parent c4d7aff5c3
commit 95efc0d688
2 changed files with 23 additions and 0 deletions

View File

@@ -159,6 +159,7 @@ class Order(_DECL_BASE):
@staticmethod
def update_orders(orders: List['Order'], order: Dict[str, Any]):
"""
Get all non-closed orders - useful when trying to batch-update orders
"""
filtered_orders = [o for o in orders if o.order_id == order['id']]
if filtered_orders:
@@ -177,6 +178,12 @@ class Order(_DECL_BASE):
o.update_from_ccxt_object(order)
return o
@staticmethod
def get_open_orders():
"""
"""
return Order.query.filter(Order.ft_is_open.is_(True)).all()
class Trade(_DECL_BASE):
"""