Reading in trades from IB to excel in real time

Discussion in 'Interactive Brokers' started by alphahunter, Oct 26, 2021.

  1. 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.
     
  2. 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.
     
    MoreLeverage likes this.
  3. d08

    d08

    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.
     
  4. We have auto-transfer tools and the API that may fix your problem. which market are you trading in?
     
  5. 2rosy

    2rosy