币安期货测试网上的空头订单导致 APIError(ReduceOnly 订单被拒绝)

Short Order on Binance futures testnet resulting in APIError (ReduceOnly Order is Rejected)

关于通过 python-binance 库使用期货测试网 API:https://github.com/sammchardy/python-binance

我在对冲模式的“买入空头”中得到了这个。我能够通过 UI 执行相同的订单并且它有效。我能够成功地使用 API 进行“买入多头”订单。 这是我的代码示例:

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

收到此回复: BinanceAPI异常:API错误(代码=-2022):ReduceOnly 订单被拒绝。

是不是我做错了什么来下空单。根据 API 文档,提到仅减少参数在对冲模式下不使用。 感谢您的帮助

想通了问题。边需要'SELL'才能短

“持仓方”必须是两者(Buy/Sell 仅用于减少现有订单)。

然后“方”买多卖空