Passing and retrieving portfolio information from IB API

Discussion in 'Automated Trading' started by AbhaySoorya, Apr 6, 2016.

  1. Hi guys,

    I've got two questions regarding the IB API:

    What I want to do is pass several orders into multiple portfolios - e.g. if I short Apple, then I want to short it in a specific portfolio. Therefore, does the API accommodate for passing an order/executing a trade with a portfolio tag attached to it?

    On that same note, is it possible to retrieve that information through IBPy? I am familiar with 'reqAccountUpdates' under the callback 'updatePortfolio', and I am able to get positions, price and cost information etc.; however, this does not seem to have a message call (i.e. message.updatePortfolio.XXXX) to get the portfolios that each open position belongs to. Is it possible to retrieve portfolio names (assuming one can pass orders to multiple portfolios)?

    Please let me know what you think.

    Regards,
    Abhay
     
  2. I don't think you can do this without setting up multiple accounts, one per portfolio. This is relatively straightforward and they can all come under the same user id.

    The alternative is to do the portfolio disaggregation in your own code.

    GAT
     
    AbhaySoorya likes this.