开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: Strange Behavior After TWS Update on Old API


 

Thank you for the update.

You may have seen the Post "One more issue/thing about reqexecutions" from Thursday, where @joanmarcel119 describes how to get reqExecutions working in TWS. It looks like TWS will not send historical execution reports until you have opened the "New Window" -> "Trade History" window. I now remember that we had this discussion a couple times before.

I just confirmed (for a paper account on Linux and a 10.17 Java API) that "stable" TWS 10.19.2p, "stable" TWS 10.30.1t, and "latest" TWS 10.33.1e show the same behavior as @joanmarcel119 describes:

  • When I start TWS and connect a client that requests historical executions, an empty list is returned
  • When the "New Window" -> "Trade History" window is open, the client receives execution and commission reports for all trades that window shows. In my case, Trade History is set to show "For Last 7 Days" and it contained 11 trades from 1/19 to 1/23.
  • For stable TWS 10.19.2p, the window must stay open, or client connection/requests result in an empty list.
  • For stable TWS 10.30.1t and latest TWS 10.33.1e, the simple fact of opening and closing the window suffices. Those versions return all expected reports even if the window is closed again.

This will not work for IBGW since the gateway does not implement any of the TWS windows (including Trade History). So IBGW will always be limited to the executions since midnight.

The fact that the TWS window has to be open/opened at least once for reqExecutions to return execution and commission reports can be viewed as a bug, but it must have been around for a while, was not introduced in 10.30 and is present in the currently stable and latest TWS versions.

So I must assume your issues were not related to the TWS versions per se. Maybe it is really time to move from the non-IBKR ibPy API (that has not been updated for 9 years and that the author calls "superfluous" since 9.73) to the IBKR provided Python API.

闯ü谤驳别苍

?

?

On Sat, Jan 25, 2025 at 01:42 PM, Adam S. wrote:

Sorry, just seeing this.? Yes, TWS had the trades in its trade history.? Once I updated TWS to 10.33 those very same trades became accessible to my by API using same code again.
?

Join [email protected] to automatically receive all group messages.