Binance futures testnet上的短订单导致APIError(拒绝ReduceOnly订单)

2024-06-17 02:16:59 发布

您现在位置:Python中文网/ 问答频道 /正文

关于通过python二进制库使用futures testnet API:https://github.com/sammchardy/python-binance

我是在对冲模式下的“买空”中得到的。我能够通过用户界面执行相同的订单,并且它可以正常工作。我能够成功地将API用于“买入多头”订单。 以下是我的代码示例:

short_order={      "symbol":"BTCUSDT",
            "side": "BUY",
            "type": "MARKET",
            "positionSide" : "SHORT",
            "quantity": "0.001"}
res = client.futures_create_order(**short_order)
print(res)

得到这样的回应: BinanceAPIException:APIError(代码=-2022):拒绝ReduceOnly订单

我是不是做错了什么事而下了短订单。仅减少参数提到,根据API文档,它不用于对冲模式。 谢谢你的帮助


Tags: 代码https订单githubcomapi对冲二进制