Chart a portfolio in TWS

Discussion in 'Interactive Brokers' started by stevenpaul, May 1, 2024.

  1. Is there any way to chart the performance (bar by bar) of a whole portfolio of stocks (with their respective share numbers) in TWS? I can imagine a study whereby different charts are summed together might work, but don't see a "sum" study. Any thoughts would be appreciated.
     
  2. Create a virtual security.

    Example:
    Code:
    200*"MSFT" + 300*"AMZN"
     
    Picaso and stevenpaul like this.
  3. Thank you! That's a great solution.

    Pushing my luck here, but I was wondering if virtual securities are somehow codable as dollar amounts rather than share quantities.

    In any case, this is already great.
     
  4. guru

    guru


    How can you use dollar amount when you cannot know the dollar amount until you display the chart to show you the dollar amount, lol.
    Wouldn’t dollar amount change every second, so even the chart wouldn’t know which dollar amount you are referring to?
     
  5. I think I understand your point. What I was trying to ask is, in setting up a virtual security, is it possible to list a target dollar value for each security, rather than a number of shares. The share number could be calculated based on the market price at the moment of creation. This can be done with orders on a security. ("Buy $10K worth of X stock.")I know it can't be done in setting up generic combos--one has to designate a number of shares in the TWS. While you can buy $10K of X as a single order, and 20K of Y as a single order, you cannot buy 10K of X and 20K of Y as a single combo order (not yet at least).

    The idea is to avoid the exact problem you refer to: the dollar amount of each security is constantly changing. I would like to maintain a precise ratio of initial dollar allocations within pairs trades. I can try to determine the number of shares per dollar at any moment and then input that number, but the moment passes so quickly. By the time I type in the right number, the data is obsolete. It would be nice if I could list the desired dollar allocation to each security, and upon pressing "enter," the interface tabulates the exact number of shares based on the NBBO or some other defined metric.