python-Binance api:APIError(代码=-1013):过滤器失败:LOT_SIZE [英] python-Binance api: APIError(code=-1013): Filter failure: LOT_SIZE

查看:36
本文介绍了python-Binance api:APIError(代码=-1013):过滤器失败: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.

现在我在 iceberg_parts 这意味着我的买卖数量可能有问题.我试图将数量增加 10 倍,但这只会给我另一个相关错误:

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(代码=-1013):过滤器失败:LOT_SIZE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆