无法进行期货交易:APIError(code=-4164):订单的名义值必须不小于 5.0

问题描述

我试图用一点钱创建一个新的期货订单以测试我的机器人,但出现错误

order=client.futures_create_order(symbol=sym,side=f'{signal}',type='MARKET',positionSide= "LONG",quantity=str(coinQuantity),Leverage=10)

error=binance.exceptions.BinanceAPIException: APIError(code=-4164): Order's notional must not less than 5.0 (除非你选择reduce only) 我真的不知道这里的概念是什么意思,是什么限制了我,我做了这个改变:

order=client.futures_create_order(symbol=sym,Leverage=10,reduceOnly='true')

但这次它也给了我这个错误:binance.exceptions.BinanceAPIException:APIError(code=-1106):不需要时发送的参数“reduceOnly”。 coinQuantity 为 0.001,符号为“ETHUSDT”。 蟒蛇 3.7.9

解决方法

文档明确指出您发送的参数在有效负载中不需要。

如果您分析响应,它会说 import numpy as np import cv2 def stackImages(scale,imgArray): rows = len(imgArray) cols = len(imgArray[0]) rowsAvailable = isinstance(imgArray[0],list) width = imgArray[0][0].shape[1] height = imgArray[0][0].shape[0] if rowsAvailable: for x in range(0,rows): for y in range(0,cols): if imgArray[x][y].shape[:2] == imgArray[x][y].shape[:2]: imgArray[x][y] = cv2.resize(imgArray[x][y],(0,0),None,scale,scale) else: imgArray[x][y] = cv2.resize(imgArray[x][y],(imgArray[0][0].shape[0]),scale) if len(imgArray[x][y].shape) == 2: imgArray[x][y] =cv2.cvtColor(imgArray[x][y],cv2.COLOR_GRAY2BGR) imageBlank = np.zeros((height,width,3),np.uint8) hor = [imageBlank]*rows hor_con = [imageBlank]*rows for x in range(0,rows): hor[x] = np.hstack(imgArray[x]) ver = np.vstack(hor) else: for x in range(0,rows): if imgArray[x].shape[:2] == imgArray[0].shape[:2]: imgArray[x] = cv2.resize(imgArray[x],scale) else: imgArray[x] = cv2.resize(imgArray[x],(imgArray[0].shape[0],imgArray[0].shape[1]),scale) if len(imgArray[x].shape) == 2: imgArray[x] =cv2.cvtColor(imgArray[x],cv2.COLOR_GRAY2BGR) hor = np.hstack(imgArray) ver = hor return ver 在您不应该发送的情况下被发送。尝试删除该参数,您应该很高兴。

有关错误代码 1106 文档的更多详细信息:https://binance-docs.github.io/apidocs/spot/en/#11xx-2xxx-request-issues

,

binance 的新更新不会让使用 api 进行的期货交易少于 5 美元(这就是名义上的意思!)所以我需要让我的交易比 5 美元多一点,比如 5.01。和 positionSide(and reduceOnly) 参数是绝对没有必要的,因为它只用于对冲情绪。 新的update

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...