python-Binance api:APIError(code = -1013):过滤器故障:LOT_SIZE [英] python-Binance api: APIError(code=-1013): Filter failure: LOT_SIZE
问题描述
当尝试使用python-binance api下达买卖订单时,出现以下错误:
When trying to place a buy or sell order with the python-binance api I got the following error:
APIError(code=-1013): Filter failure: LOT_SIZE.
Now I've seen at iceberg_parts that this means there is probably something wrong with my buying or selling quantity. I've tried to increase the quantity by a factor 10 but this only gives me another related error:
APIError(code=-1013): Filter failure: MIN_NOTIONAL.
这是我的一些代码:
diff = current_price - prev_price
if diff <= 0.0001:
order = client.order_market_buy(symbol = market , quantity = '0.0001')
print('buy order')
if diff >= 0.00040:
order = client.order_market_sell(symbol =market, quantity ='0.0001')
print('sell order')
您知道如何解决此问题吗?
Do you know how to fix this?
推荐答案
出现此错误是因为您试图创建数量小于所需最小数量的订单.
This error appears because you are trying to create an order with a quantity lower than the minimun required.
您可以通过以下方式访问特定货币对的最低要求:
You can access the minimun required of a specific pair with:
info = client.get_symbol_info('ETHUSDT')
print(info)
输出包含有关该对信息的字典.现在,您可以通过以下方式访问所需的最小数量:
Output a dictionary with information about that pair. Now you can access the minimun quantity required with:
print(info['filters'][2]['minQty'])
# 0.00001
这篇关于python-Binance api:APIError(code = -1013):过滤器故障:LOT_SIZE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!