How to liquidate a portion of a portfolio?

Discussion in 'Interactive Brokers' started by HappyTrader, Jan 12, 2022.

  1. Let's say you have ~ 100 positions, with share size ranging from 10 to 10,000.

    And let's say you wish to liquidate 1% of your portfolio.

    Is there a reasonable way to do this?

    Presently, with 'Select All', 'Close All', 'Custom %', 1%, I get an error (since it can not do 1% of 10 positions).

    Ideally it would populate a ticket with 0 for positions < 100 (and thus allow me to choose to manually rectify it to 1).

    Thank you.
     
  2. deaddog

    deaddog

    Get rid of your worst performers
     
    Chuck Krug likes this.
  3. Overnight

    Overnight

    But how do you know the worst performers will not start to perform better? Like T? (world's worst stock over 140 years old BTW, I hate them).

    It is still there though, not out of the realm of possibility! It is getting upgrades now!
     
  4. Do you want to liquidate 1% of 100 positions? Meaning closing one position?
    Or do you want to liquidate 1% of every position you have? I guess this is what you are after? The disadvantage of this is that you will pay commission on 100 trades.
     
  5. I wish to liquidate 1% of each of the positions.

    I understand there will be trading fees. But this is something that would be done once per year or so.
     
  6. deaddog

    deaddog

    You can't possibly know. But then you don't know which stock out there in the market that you don't own is going to double tomorrow. How long do you hold onto a stock because your afraid it might go up if you sell it?

    You don't want to let FOMO control your trading.
     
  7. I see. I don't place manual trades in TWS so I don't know whether this is something that you can achieve in TWS.
    If you know how to use IB's API then it is not too complicated to program this (with x% being the portion by which you want to reduce the position size):
    Step 1. Get all positions in your portfolio.
    Step 2: For each position:
    Step 2a: calculate the trade quantity which is x% of the current position size.
    Step 2b: if this trade quantity is > 0.5 place a sell order of the rounded quantity.
     

  8. Yes, I thought about this. But since this is something that would be rarely done, did not wish to write a script to do it. Was hoping there was some better way to do it in the program itself.
     
  9. calculate in an Excell sheet