From 93629b4b2193a992b86919e7ad864cb6d201fdeb Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Tue, 16 Jul 2024 00:51:09 +0200 Subject: [PATCH] [Bingx] fix order cancel and precision issues --- Trading/Exchange/bingx/bingx_exchange.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/Trading/Exchange/bingx/bingx_exchange.py b/Trading/Exchange/bingx/bingx_exchange.py index 5048e804f..4ec5f93c4 100644 --- a/Trading/Exchange/bingx/bingx_exchange.py +++ b/Trading/Exchange/bingx/bingx_exchange.py @@ -27,7 +27,13 @@ class Bingx(exchanges.RestExchange): EXCHANGE_ORDER_NOT_FOUND_ERRORS: typing.List[typing.Iterable[str]] = [ # 'bingx {"code":100404,"msg":" order not exist","debugMsg":""}' ("order not exist",), + # bingx {"code":100404,"msg":"the order you want to cancel is FILLED or CANCELLED already, or is not a valid + # order id ,please verify","debugMsg":""} + ("the order you want to cancel is filled or cancelled already", ), ] + + # Set True when get_open_order() can return outdated orders (cancelled or not yet created) + CAN_HAVE_DELAYED_CANCELLED_ORDERS = True def get_adapter_class(self): return BingxCCXTAdapter @@ -57,16 +63,3 @@ def fix_order(self, raw, **kwargs): except KeyError: pass return fixed - - def fix_market_status(self, raw, remove_price_limits=False, **kwargs): - # on bingx, amounts are precisions in the right unit, do not patch precision - market_status = raw - if remove_price_limits: - market_status[trading_enums.ExchangeConstantsMarketStatusColumns.LIMITS.value][ - trading_enums.ExchangeConstantsMarketStatusColumns.LIMITS_PRICE.value][ - trading_enums.ExchangeConstantsMarketStatusColumns.LIMITS_PRICE_MIN.value] = None - market_status[trading_enums.ExchangeConstantsMarketStatusColumns.LIMITS.value][ - trading_enums.ExchangeConstantsMarketStatusColumns.LIMITS_PRICE.value][ - trading_enums.ExchangeConstantsMarketStatusColumns.LIMITS_PRICE_MAX.value] = None - - return market_status