From 5025f72fe1c071d2911862554c7122a7d7fa7add Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Wed, 27 Nov 2024 11:15:13 +0100 Subject: [PATCH 1/2] [Bitmex] update tentacle --- Trading/Exchange/bitmex/bitmex_exchange.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Trading/Exchange/bitmex/bitmex_exchange.py b/Trading/Exchange/bitmex/bitmex_exchange.py index 84eefa073..49e6b51bc 100644 --- a/Trading/Exchange/bitmex/bitmex_exchange.py +++ b/Trading/Exchange/bitmex/bitmex_exchange.py @@ -19,6 +19,7 @@ class Bitmex(exchanges.RestExchange): DESCRIPTION = "" + FIX_MARKET_STATUS = False # todo fix precision price but not amount ? todo check BUY_STR = "Buy" SELL_STR = "Sell" @@ -36,9 +37,6 @@ def get_supported_exchange_types(cls) -> list: :return: The list of supported exchange types """ return [ + trading_enums.ExchangeTypes.SPOT, trading_enums.ExchangeTypes.FUTURE, ] - - async def get_recent_trades(self, symbol, limit=50, **kwargs): - kwargs.update({"reverse": True}) - return await super().get_recent_trades(self, symbol=symbol, limit=limit, **kwargs) From f8dbf2e90ad998723aca759a94e9c114b11c69ea Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Wed, 27 Nov 2024 19:27:09 +0100 Subject: [PATCH 2/2] [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..946af2261 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 + ] = 0 + limits[trading_enums.ExchangeConstantsMarketStatusColumns.LIMITS_AMOUNT.value][ + trading_enums.ExchangeConstantsMarketStatusColumns.LIMITS_AMOUNT_MAX.value + ] = None + + return fixed