softwarespartan / IB4m

Interactive Brokers API for Matlab
GNU General Public License v2.0
61 stars 21 forks source link

End of reception events #115

Open webberd1wei opened 3 years ago

webberd1wei commented 3 years ago

Hi Abel, let me start by saying great work of IB4m. I wished I found out about this work a bit earlier, that would have saved me a lot of trouble.

I read a closed issue on historicalDataEnd, I want to make sure I understand and it applies to a few other similar end of reception events. Regarding these ~End events that are only being triggered at the end of certain requests (reqHistoricalData, reqPositions etc), how can I place a listener to them, if these events are not in the list of Events?

Thanks

softwarespartan commented 3 years ago

Thanks for reaching out. Yes, sometimes there is a one-to-one correspondence between an api call and the return event (e.g. one call yields single event). However, some api calls like historical data request can return many data for a single call. Also, these requests are finite, meaning it's not an endless subscription/steaming type api call (e.g. requesting market data stream).

In these cases, typically IB4m will aggregate the return values and return a single event with all the data for the particular api call. then when the end callback is called it triggers IB4m to send over all the accumulated data as single event. It's also easier/clean on the end-user since do not have to subscribe to multiple events just to know when your api call is done. The result is just a single aggregate event into MATLAB.

In any case, let me know if there is use-case/need here that explicitly requires the end-events and happy to expose them if needed.

bondtrade commented 2 years ago

Thanks Gents. Does this apply to: openOrderEnd?