简体   繁体   English

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

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

On using futures testnet API through python-binance library: https://github.com/sammchardy/python-binance关于通过python-binance库使用期货测试网API: https://github.com/sammchardy/python-binance

I am getting this in 'Buy Short' in Hedge mode.我在对冲模式的“买空”中得到这个。 I am able to execute the same order via the UI and it works.我能够通过 UI 执行相同的订单并且它可以工作。 I am able to use the API for 'Buy Long' orders successfully.我能够成功使用 API 进行“买入多头”订单。 Here is my code sample:这是我的代码示例:

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

Getting this response: BinanceAPIException: APIError(code=-2022): ReduceOnly Order is rejected.收到此响应:BinanceAPIException: APIError(code=-2022): ReduceOnly 订单被拒绝。

Is there something that I'm doing wrong to place the Short order.下短单时我做错了什么吗? Reduce-only parameter is mentioned that it is not used in Hedge mode according to API docs.根据 API 文档,提到了仅减少参数,它不在 Hedge 模式下使用。 Thanks for your help谢谢你的帮助

Figured the problem.想通了问题。 The side needs to be 'SELL' to short.一方需要“卖出”才能做空。

The "Position Side" need to be BOTH (Buy/Sell is for reduce existing order only). “头寸方”必须是 BOTH(买入/卖出仅用于减少现有订单)。

Then the "Side" Buy for LONG and Sell for SHORT.然后“边”买入做多,卖出做空。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python Binance Futures - 创建止盈限价订单时出现问题 ->(APIError(代码=-2021):订单会立即触发。) - Python Binance Futures - problem creating Take Profit Limit order -> (APIError(code=-2021): Order would immediately trigger.) python-binance我可以创建一个reduceonly订单 - python-binance i can create a reduceonly order 如何取消期货币安订单? - How to cancel futures binance order? 如何使用 python-binance 下期货市场订单:APIError(code=-1111): Precision is over the maximum defined for this assets - How to place a futures market order using python-binance: APIError(code=-1111): Precision is over the maximum defined for this asset 如何在 python 中使用 ccxt 制作币安期货订单? - How to make a binance futures order with ccxt in python? 币安期货 API 以检索填充订单作为信号 - Binance futures API to retrieve filled order as signal Python 币安 Api 保证金空单 - Python Binance Api Margin Short Order 我无法获取币安期货订单历史数据 - I can't get binance Futures order book historical data 无法进行期货交易:APIError(code=-4164):订单的名义值必须不小于 5.0 - Futures trading not possible: APIError(code=-4164): Order's notional must be no smaller than 5.0 使用 python-binance 包装器放置 Binance 未来订单。 错误:APIError(代码=-1102):未发送强制参数“5e-05” - Place Binance Future Order using python-binance wrapper. Error: APIError(code=-1102): Mandatory parameter '5e-05' was not sent
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM