I can confirm that TWS 10.30.1p indeed sends unsolicited commission and execution reports upon client connection, if the "Trade History" window is open. But I cannot believe that this is intended behavior and I am not sure which other TWS versions show this behavior.
The correct way to get commission and execution reports for recent orders is a call to If your client needs historical execution and commission reports, it should call reqExcutions. The only documented relationship between "Trade History" in TWS and calls is the time period for which trade details are available. The "" chapter says:
Important: By default, only those executions occurring since midnight for that particular account will be delivered. If you want to request executions up to last 7 days, TWS's Trade Log setting "Show trades for ..." must be adjusted to your requirement. Please note, that IB Gateway would be unable to change the Trade Log's settings, thus limited to only executions since midnight to be delivered.
闯ü谤驳别苍
PS. When my client called during startup while TWS had an open Trade History windows, all commission and execution reports as well as were received twice.
?
On Fri, Nov 15, 2024 at 04:37 PM, <simon.meier1987@...> wrote:
toggle quoted message
Show quoted text
Hi all,
i noticed a difference in the behaviour of the execDetails(...)+commissionReport(...) Callback functions. When i start the tws and do not open the "trade history" dialog then all orders that are opened or closed from this point are only "returned" ONCE in the execDetails(...) + commissionReport(...). Furthermore i do not receive the previous trading history ( more precise all executions and commission reports that occured before the new start of tws). If i open the dialog shortly after the start of the tws i receive all the executions and it keeps sending them in a regular time intervall.
?
The reason why i am asking ( or created a topic), is that my trading system gets invalidated if i dont receive all the execution (i cant determined when a position is closed and the is no other way with this design). The problem is that the tws is restarting every day, so i get this set of conditions (after restart -> the dialog hasn't been opened, without intervening) and thus the callbacks are sending only once.?
?
Is it possible that a message is lost ( due to connection problems) ? If so, is there some mechanism to get the dialog open? automatically ? Or how can i enforce it that the callbacks are sending periodically ? How is this solved in the IB Gateway ?
?
regards,
Simon
?
?