40 limit order signals but only have 10 positions available

Discussion in 'Interactive Brokers' started by Sam Mcgee, Sep 17, 2020.

  1. I have a mean reversion limit order system that calculates 40 possible limit order signals each morning at a percentage below the opening price. For an example, I want to trade $100,000, with 10 positions at $10,000 each. For tax reasons etc, I don't want to use margin and so I can only send out 10 of the 40 limit orders each day. Most days only 1 or 2 of the limit orders will get hit. If I could use all the 40 limit orders, a lot more than just 1 or 2 orders would get hit and my system would perform a lot better. However, without using margin, Interactive Brokers will stop me from sending out more than 10 orders at $10,000 each with a $100,000 account.

    One solution would be to have my 40 limit orders in an Excel spreadsheet connected to IB that monitors the prices. Excel wouldn't send out any of the 40 limit orders until the price got down close to the limit price. That way if one of the limit orders got sent out, I would still have 9 positions available. This would be a complicated and tedious program to run.

    Perhaps there's a simpler way to do it with a different type of order built into IB? Is there some kind of a conditional order or something which would only send a limit order if the price got down close to my limit price? That way I wouldn't use up all of my 10 orders if I sent out limit orders at the opening. An example would be, the stock opened at $10, my limit order was set at 10% below the open at $9. If the stock price went below $9.10, my limit order would then get sent out for $9 and I'd still have 9 positions available for the other 39 calculated limit orders.
     
  2. guru

    guru

    Maybe OCA (one-cancel-another) orders where each filled order would cancel or reduce the others within specific order combination?

    upload_2020-9-17_16-55-59.png
     
    Sam Mcgee likes this.
  3. qlai

    qlai

    Maybe you can create stop limit orders which are only triggered when stock trades through certain price. This way, orders are held at IB until triggered. I am not sure if this can work with IB. Easy to test.
     
    Sam Mcgee likes this.
  4. ValeryN

    ValeryN

    If you have a margin account - IB will NOT reject your 40 orders. You can have them hanging there till enough of them get filled and eventually you can't meet initial margin requirements. For that you don't have to actually USE the margin = borrow money, just have that type of account if enough.

    Not sure how cash account would work but I would be surprised if that's much different.

    Either way, to effectively manage this situation you will need custom software.

    This is beyond what the ones available to retail traders can do out of the box.

    If you can have all of them at the same time - the tricky part is when market moves too fast (flash crash).

    Ideal universal solution would be maintaining only 10 closest LMT orders. But again, no retail software I know of can do that. My guess it - error handling and potential duplication of orders becomes too much of a liability for developers.

    Val
     
    Sam Mcgee likes this.
  5. Would it be possible to evaluate all 40 instruments first and determine how many fulfill your criteria. Then determine the amount to allocate to each of those instruments based on your total account size. For example: 23 instruments meet the criteria and your account size is $100,000. Then you allocate $4,347 to each of these trades.
    However, I fear that this is not directly possible in TWS and that you would need to write some software to create this approach.
     
    Sam Mcgee likes this.
  6. Yes, I did try that but for this non margin/retirement account, IB stops me after I send 10 orders of 10% each for the account for a stop limit order, just the same as a limit order.
     
  7. Each of the 40 limit orders has a score calculated so I can select the top 10 or any number of them to send. However, if I only send 10 limit orders, on average only 1 or 2 will get hit each day and my yearly return will be say only 15%. If I can send 40 orders, on average 4 or 5 will get hit and my yearly return might average over 30%.

    The tax system for trading is different here in Canada. For all of my trading, I can get away with capital gains tax at 1/2 the full income tax rate. In the US or other countries, if you hold your trade for less than one year, I believe that you have to pay full income tax. However, if I trade so frequently such as for this system, Revenue Canada can arbitrarily demand full income tax. In my retirement account, I can get away with frequent trading, as long as I don't short sell, or buy leveraged equities like futures. However in my retirement account, leverage is not allowed either.

    I think some custom software might be my solution. I can get real time data from TWS into Excel, I can upload my 40 potential limit orders into Excel and I can execute the first 10 orders to get hit from Excel to TWS. It wouldn't be easy for me as a non professional programmer, I may have to hire help. I don't think I have to worry about a mistake where more than the 10 orders get sent out as IB would automatically reject the 11th limit order.
     
    They likes this.
  8. ValeryN

    ValeryN

    Sounds like the right path to take.

    Over the years I created pretty sophisticated execution software for myself that is designed to run on a remote server autonomously. It supports your scenario. But I am too busy to pursue commercialization of it. For now it just runs all my personal strategies so I don't have to watch them intraday.

    Val
     
    Sam Mcgee likes this.
  9. Poljot

    Poljot

    Sam, cannot you open 3 more accounts with different brokers?
    It would also decrease your counter-party risk.
     
  10. I can start out quite easily just by using the sample TWS DDE Excel sheet from Interactive Brokers and run the real time data from the 40 potential limit orders. It wouldn't be hard to set audible alerts if any of the limit orders get close and then I could manually send out the limit orders one by one. Later on I can change the audible alerts to actual limit orders that get sent to TWS.
     
    #10     Sep 18, 2020