交互式经纪人:如何检索交易历史记录?

时间:2022-09-11 14:59:19

Basically, I want to use python to query my IB order history and do some analyze afterwards. But I could not find any existing API for me to query these data, does anyone have experience to do this?

基本上,我想使用python查询我的IB订单历史记录,然后进行一些分析。但我找不到任何现有的API来查询这些数据,有没有人有经验这样做?

2 个解决方案

#1


0  

TWS API doesn't have this functionality. You can't retreive order history, but you can get open orders using recOpenOrders request and capture executions in realtime by listening to execDetails event - just write them to a file and analyse aftewards.

TWS API没有此功能。您无法检索订单历史记录,但您可以使用recOpenOrders请求获取未结订单并通过监听execDetails事件实时捕获执行 - 只需将它们写入文件并进行后续分析即可。

#2


0  

You have to use flex queries for that purpose. It has full transaction history including trades, open positions, net asset value history and exchange rates.

您必须为此目的使用弹性查询。它有完整的交易历史记录,包括交易,未平仓头寸,净资产价值历史和汇率。

#1


0  

TWS API doesn't have this functionality. You can't retreive order history, but you can get open orders using recOpenOrders request and capture executions in realtime by listening to execDetails event - just write them to a file and analyse aftewards.

TWS API没有此功能。您无法检索订单历史记录,但您可以使用recOpenOrders请求获取未结订单并通过监听execDetails事件实时捕获执行 - 只需将它们写入文件并进行后续分析即可。

#2


0  

You have to use flex queries for that purpose. It has full transaction history including trades, open positions, net asset value history and exchange rates.

您必须为此目的使用弹性查询。它有完整的交易历史记录,包括交易,未平仓头寸,净资产价值历史和汇率。