Hello, For years I have exported my trade file from IB to my computer and then read it into an excel file to be able to see my positions as quickly as possible. However, because sometime the auto export function on IB can take a minute (or 2 or 5 minutes in some cases) I was wondering how to do this faster- as I often can benefit by having my position in excel within seconds of trading. Is there a way to force manual exports or possibly stream the position directly into excel with the API. Has anyone does this successfully or has advise on improving this. Thanks.
Yes, this can be done with the API. It can report all trade executions to you the moment they occur. https://interactivebrokers.github.io/tws-api/executions_commissions.html The API is available in multiple software languages. There is a version which works directly in Excel (I don't have experience with this), or you can use another language and write the results to a csv file which you can read with Excel or another spreadsheet program.
The best solution is probably a non-Excel (DDE/ActiveX) API for reliability like Python, API queries read into a dictionary, then easily read into a Pandas dataframe which is exported to Excel. The Excel APIs are usable but with lower reliability, works if you're not leaving it unattended.
can use python's ib_insync pkg https://github.com/erdewit/ib_insync/blob/master/notebooks/basics.ipynb get the positions() convert to panda dataframe df = util.df(positions) df.to_excel()