IB TWS max. number of open positions feature.

Discussion in 'Risk Management' started by saico, Feb 12, 2011.

  1. saico


    Hi everyone,

    for my trading I use baskets of about 100 stocks. For risk management reasons I devide the stocks I trade into OCA groups. The problem that sometimes occurs is, that stocks of one group get cancelled after a fill within a group that would have perform well.

    The solution for me would be an API, or a TWS feature that cancels all open orders after a certain amount of fills occured.

    It would be great if someone could help.

    Thanks in advance!

  2. If you want IB to add something why don't you go on their forum and request it.
  3. Many people have a regular job, and can't watch their positions.

    I would think that a little tool to add some trade management/money management could be very helpful. Say, if S&P drops 100 points, cancel all entries. If it drops 200 points, close out long positions.

    It would need to be custom though.
  4. drp7804


    If you wanted some automated way to allow only X trade entries per day and cancel any open orders beyond X... I would think that'd mean coding up something and using the IB API. It wouldn't have to be too complicated, especially if all of the order placement is manual. Just have the tool listen to the execution details (or order status) callback and when you hit that "X" threshold for the day, have it send cancellations for all the remaining orders (learn what those order IDs are by requesting all open orders). No need to worry about market data feeds, etc.