From f42672fc683d24244d9fb29ed5b5d8216109ea2f Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Wed, 27 Nov 2024 19:19:45 +0100 Subject: [PATCH] [BingX] fix market status --- Trading/Exchange/bingx/bingx_exchange.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Trading/Exchange/bingx/bingx_exchange.py b/Trading/Exchange/bingx/bingx_exchange.py index b5565957b..17094a5c2 100644 --- a/Trading/Exchange/bingx/bingx_exchange.py +++ b/Trading/Exchange/bingx/bingx_exchange.py @@ -68,3 +68,19 @@ def fix_order(self, raw, **kwargs): except KeyError: pass return fixed + + def fix_market_status(self, raw, remove_price_limits=False, **kwargs): + fixed = super().fix_market_status(raw, remove_price_limits=remove_price_limits, **kwargs) + if not fixed: + return fixed + # bingx min and max quantity should be ignored + # https://bingx-api.github.io/docs/#/en-us/spot/market-api.html#Spot%20trading%20symbols + limits = fixed[trading_enums.ExchangeConstantsMarketStatusColumns.LIMITS.value] + limits[trading_enums.ExchangeConstantsMarketStatusColumns.LIMITS_AMOUNT.value][ + trading_enums.ExchangeConstantsMarketStatusColumns.LIMITS_AMOUNT_MIN.value + ] = None + limits[trading_enums.ExchangeConstantsMarketStatusColumns.LIMITS_AMOUNT.value][ + trading_enums.ExchangeConstantsMarketStatusColumns.LIMITS_AMOUNT_MAX.value + ] = None + + return fixed