Add Emergencyselling after X timeouts have been reached

This commit is contained in:
Matthias
2021-11-06 11:48:49 +01:00
parent d99eaccb5a
commit 7a907a7636
5 changed files with 20 additions and 2 deletions

View File

@@ -491,6 +491,14 @@ class LocalTrade():
def update_order(self, order: Dict) -> None:
Order.update_orders(self.orders, order)
def get_exit_order_count(self) -> int:
"""
Get amount of failed exiting orders
assumes full exits.
"""
orders = [o for o in self.orders if o.ft_order_side == 'sell']
return len(orders)
def _calc_open_trade_value(self) -> float:
"""
Calculate the open_rate including open_fee.
@@ -775,7 +783,7 @@ class Trade(_DECL_BASE, LocalTrade):
return Trade.query
@staticmethod
def get_open_order_trades():
def get_open_order_trades() -> List['Trade']:
"""
Returns all open trades
NOTE: Not supported in Backtesting.