【问题标题】:How to get the trading price and commission in Interactive Brokers new API (9.73) after placing an order?下单后如何在盈透证券新API(9.73)中获取交易价格和佣金?
【发布时间】:2018-03-11 09:54:58
【问题描述】:

我正在研究新的 Interactive Brokers python API 框架 ib_insync。我想不通的一件事是如何在下市价单后获得交易价格。有人知道了吗?

我见过this question,但它是针对旧 API 和 IBPY 的。

【问题讨论】:

标签: interactive-brokers


【解决方案1】:

如果有人想知道,以下是获取您买入/卖出价格的方法:

from ib_insync.order import MarketOrder    
order = MarketOrder(action, quantity)
trade = self.ib.placeOrder(contract, order)
# Wait for the trade to complete
...
filled_quantity = trade.filled()
filled_price = trade.orderStatus.avgFillPrice

【讨论】:

    猜你喜欢
    • 2015-07-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多