簡體   English   中英

下訂單后如何在盈透證券新API(9.73)中獲得交易價格和佣金?

[英]How to get the trading price and commission in Interactive Brokers new API (9.73) after placing an order?

我正在查看ib_insync,這是新的Interactive Brokers python API的框架。 我不知道的一件事是如何在下達市價單后獲得交易價格。 有人知道嗎?

我已經看到了這個問題 ,但這是針對舊的API和IBPY的。

如果有人想知道,以下是獲取購買/出售價格的方法:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM