Skip to content

Commit

Permalink
Merge pull request #1303 from Drakkar-Software/dev
Browse files Browse the repository at this point in the history
[Bingx] fix order cancel and precision issues
  • Loading branch information
GuillaumeDSM authored Jul 17, 2024
2 parents 9acafa5 + 93629b4 commit 4131ffd
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions Trading/Exchange/bingx/bingx_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 4131ffd

Please sign in to comment.