Is the API updatePortfolioEx not very timely reliable?

Discussion in 'Interactive Brokers' started by jerron, Jul 7, 2023.

  1. jerron

    jerron

    My application uses the event updatePortfolioEx after call to IBApi.EClient.reqAccountUpdates periodically to fetch the portfolio changes. However I found it not very timely reliable, especially after a few hours running since TWS launched. Quite often my application won't get updating after the order was executed for tens of minutes. Sometimes I manually click the "reconnect all farms" button in the "connection" window would help to wake up the API in a short period before it goes to sleep again. Is anyone here seeing the same thing? Any suggestions to fix / walk around? Thanks.
     
  2. For reqAccountUpdates you should listen to:
    - UpdateAccountValue: Will give you one update per field in your account.
    - UpdatePortfolio: Will give you positions per contract
     
  3. d08

    d08

    reqAccountUpdates isn't called periodically. You call it once with a boolean. Afterwards you cancel it with a boolean. Sounds like you keep making unnecessary requests until IB stops responding to duplicate ones.
     
    rb7 and Drawdown Addict like this.
  4. d08

    d08

    HobbyTrading likes this.