Skip to content

Commit

Permalink
Merge pull request #1393 from Drakkar-Software/dev
Browse files Browse the repository at this point in the history
Dev merge
  • Loading branch information
GuillaumeDSM authored Nov 27, 2024
2 parents 3f5c1ee + f8dbf2e commit 236dd82
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
16 changes: 16 additions & 0 deletions Trading/Exchange/bingx/bingx_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 2 additions & 4 deletions Trading/Exchange/bitmex/bitmex_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)

0 comments on commit 236dd82

Please sign in to comment.