繁体   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