Allow simulating cancelled orders in dry-run

This commit is contained in:
Matthias 2020-08-26 21:22:36 +02:00
parent 309ea1246a
commit d161b94d72

View File

@ -973,6 +973,11 @@ class Exchange:
@retrier @retrier
def cancel_order(self, order_id: str, pair: str) -> Dict: def cancel_order(self, order_id: str, pair: str) -> Dict:
if self._config['dry_run']: if self._config['dry_run']:
order = self._dry_run_open_orders.get(order_id)
if order:
order.update({'status': 'canceled', 'filled': 0.0, 'remaining': order['amount']})
return order
else:
return {} return {}
try: try: