How to get all active positions using IB Java API?

Discussion in 'Automated Trading' started by babyan, Dec 24, 2012.

  1. babyan

    babyan

    Hi,

    I went through IB's java API and do not see any function for getting all current stock/option positions in my portfolio. What I am trying to do is: get all current/active positions in my portfolio ( positions may or may not sent from API ), then loop through the list to close the one that matches my criteria. Is there any way to do that?

    thanks,
     
  2. gkishot

    gkishot

    Check out reqAccountUpdates() and it's callback updatePortfolio().
     
  3. babyan

    babyan

    Thanks a lot. Will try it once market is open.