Add fetch_dry_run_order method

This commit is contained in:
Matthias
2021-06-02 11:06:32 +02:00
parent 10cd89a99d
commit 67beda6c92
2 changed files with 20 additions and 17 deletions

View File

@@ -93,13 +93,8 @@ class Ftx(Exchange):
@retrier(retries=API_FETCH_ORDER_RETRY_COUNT)
def fetch_stoploss_order(self, order_id: str, pair: str) -> Dict:
if self._config['dry_run']:
try:
order = self._dry_run_open_orders[order_id]
return order
except KeyError as e:
# Gracefully handle errors with dry-run orders.
raise InvalidOrderException(
f'Tried to get an invalid dry-run-order (id: {order_id}). Message: {e}') from e
return self.fetch_dry_run_order(order_id)
try:
orders = self._api.fetch_orders(pair, None, params={'type': 'stop'})