Allow simulating cancelled orders in dry-run
This commit is contained in:
parent
309ea1246a
commit
d161b94d72
@ -973,7 +973,12 @@ 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']:
|
||||||
return {}
|
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 {}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return self._api.cancel_order(order_id, pair)
|
return self._api.cancel_order(order_id, pair)
|
||||||
|
Loading…
Reference in New Issue
Block a user