binance python api通过ID

发布于 2025-02-13 18:36:10 字数 371 浏览 0 评论 0原文

我需要关闭以前打开的订单:

order_id = "test"
symbol = "BTCUSDT"
direction = "long"
quantity = "0.1"

order = client.futures_create_order(newClientOrderId=order_id, symbol=symbol, side=direction, type=ORDER_TYPE_MARKET, quantity=quantity)

有没有办法说binance以市场价格关闭它,例如:

client.futures_close_order(orderId=order_id)

谢谢您!

I need to close an order previously opened with:

order_id = "test"
symbol = "BTCUSDT"
direction = "long"
quantity = "0.1"

order = client.futures_create_order(newClientOrderId=order_id, symbol=symbol, side=direction, type=ORDER_TYPE_MARKET, quantity=quantity)

Is there a way to say Binance to close it at market price like:

client.futures_close_order(orderId=order_id)

Thank you in advanced!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

漫漫岁月 2025-02-20 18:36:10
  1. 如果您有一个打开订单(仍在等待填充的订单),则很容易通过Endpoint delete/fapi/v1/订单

    取消。

  2. 如果您指的是职位,则可以下达另一个订单(可以是市场,限制等)以关闭它。

  1. If you have an OPEN order ( an order that is still waiting for filling), it's easy to cancel via endpoint DELETE /fapi/v1/order.

  2. If you are referring to a position, you can place another order (can be MARKET, LIMIT, etc) to close it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文