精度超过了该资产定义的最大定义。 binance?
我的代码
if side == "LONG" and client.futures_get_open_orders(symbol=symbol) == []:
print(data)
pos = "BUY"
q = tbal / price
q = round(q, 1)
print(tbal)
print(q)
client.futures_change_leverage(symbol=symbol, leverage=info.laverage)
buyorder = client.futures_create_order(symbol=symbol, side=pos, type="LIMIT", quantity=q, price=price, timeInForce="GTC")
错误:
binance.exceptions.BinanceAPIException: APIError(code=-1111): Precision is over the maximum defined for this asset.
我已经尝试了所有内容,但它仍然无法正常工作
My code
if side == "LONG" and client.futures_get_open_orders(symbol=symbol) == []:
print(data)
pos = "BUY"
q = tbal / price
q = round(q, 1)
print(tbal)
print(q)
client.futures_change_leverage(symbol=symbol, leverage=info.laverage)
buyorder = client.futures_create_order(symbol=symbol, side=pos, type="LIMIT", quantity=q, price=price, timeInForce="GTC")
error:
binance.exceptions.BinanceAPIException: APIError(code=-1111): Precision is over the maximum defined for this asset.
I have tried everything, but it still dont working
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
错误1111仅仅是因为您使用的价格高于允许的小数位数的最大数量。
例如,如果ticksize返回0.01,则最大允许该符号的十进制位置为2。
Error 1111 is simply because the price you have used is above the maximum number of decimal places allowed.
For example, if tickSize returns 0.01, max allowed decimal places for that symbol will be 2.
您需要从Binance Exchange信息端点获得允许的PricePrecision。
这是Binance Docs 的链接
You need to get the pair allowed pricePrecision from binance exchange info endpoint.
Here is the link to the binance docs
您必须以二元定义的精度传递符号。如果您检查二元的股票价格,您将知道那里定义的精度。例如:0.234,精度为4,如果将精度的值超过4的值,您将获得错误的“精度超过此资产定义的最大定义”
来解决此问题,请阅读二元的股票价格,然后读取'小数数量'以股票价格,将您传递给小数的符号价值(在您的情况下)弄清楚。它将解决您的问题。
You have to pass the symbol with precision defined by Binance. If you check the ticker price on Binance, you will know the precision defined there. Ex: 0.234, precision is 4 , if you pass a value of precision above 4, you will get error 'Precision is over the maximum defined for this asset'
To fix this, read the ticker price from binance, then read 'number of decimals' in the ticker Price, round off the symbol value(price in your case) that you pass to that decimals. It will fix your problem.
解决方案是在代码中使用“ Math.floor”。这样,脚本将使用您的数字的最接近值,然后根据此应用其余的计算。
The solution is to use "math.floor" before applying round in your code. This way, the script will use the nearest lower value of your number and then apply the rest of your calculations based on that.