开云体育

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

Re: execDetails(...)+commissionReport(...) Callback different behaviour when not opening trade history


 

Just to confirm that you are talking about historical tradeReports right after the call to reqExecutions and before the tradeReportEnd clall back. You are not talking about real-time reports right after order fills, right?

I can confirm this behavior for when the markets were closed over the weekend, and today at 16:30 US/Central during the CME/CBOT daily trading pause hour (my trade reports were for various futures). But just before 17:00 US/Central on Sunday and today and during trading hours, historical trade reports were delivered right after reqExecutions calls regardless of whether the Trade History window was open or not. This is probably a question for IBKR, but there are other request types with a disclaimer in the documentation that they only work when exchanges are open.

But coming back to your other questions. If I understand you correctly, you are trying to create a reliable "position" monitor within your client application. Both getting the an initial correct state when the client starts as well timely updates in real time when your orders fill.

For my taste, historical trade reports are not well suited to do that, considering that they generally are only available for the time since midnight (IBGW and TWS default) and only manual configuration of the TWS Trade History windows give you a longer historical view. Also, when you look at the (simplified) data model below, trade reports are pretty far removed from the notion of "Position" and subscriptions that get you updatePortcolio, position, pnl, and order status callbacks give you better data for position monitoring.

I did not understand your comment about position updates when you say "By using the position(..) + positionEnd(...) ? In my case it sends the close again and basically opens the symbol in the other direction". You would:

  • call to subscribe to position updates
  • for each first call back for an instrument you'd create an internal "Position" object
  • you can configure TWS/IBGW in the API configuration section whether they should send you "empty" positions (e.g. recent positions that now have a quantity of 0).
  • you know that you have seen all currently open positions when you receive the callback
  • and for each subsequent call back for that instrument, you'd update your internal "Position" object accordingly.

闯ü谤驳别苍

?

?

On Sun, Nov 17, 2024 at 09:07 AM, <simon.meier1987@...> wrote:

Update:
i checked the version of the tws and its 10.30.1q, and i dont receive the executions until i open the dialog

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