IB "demouser" account short sells always going to "locate" status

Discussion in 'Automated Trading' started by clearinghouse, May 15, 2011.

  1. I'm trying to test my logic with short sells, and with the edemo/demouser account, almost all of my short sells end up going into a "locate" state -- even trades where I click manually to short sell. The problem is, the "locate" state takes forever to resolve on the demouser account.

    Even if I do it manually, the orders take several seconds to resolve and shorting is nowhere near instantaneous. Is this behavior specific to the symbol I'm using, or does this happen for all symbols? And does the same thing happen in production every single time?

    Is this some undocumented quirk with the demo system?
     
  2. The demo account by it's very nature is not "real". You can log on anytime day or night and there's a party going on which is great for basic ATS testing on weekends, but for strategy development the data is junk. Orders placed there are as likely to generate any number of errors as actually fill like a normal order. Market orders on the long side will have delays like you are seeing with shorts. Again, great for ATS testing since you get errors thrown at you that don't occur that often in real trading, and generally these errors should be handled.

    If you have an account at IB you can open a "simulator" account. They give you a fake account loaded with fake money but using actual data from the exchanges and more realistic order handling. That's a step closer to real trading but still not perfect.
     
  3. Thanks, this is what I guessed. But I am concerned about the behavior of this locate-state in production. Will locates resolve much quicker, or will my order actually sit in some strange pre-submitted state for hours while a locate resolves?

    Here's a scenario I'm worried about:

    --> Order Send
    <-- Presubmit (locate)
    --> Cancel
    <-- OrderAck (IB state "Submitted")
    <-- Fill
    <-- Cancel Rejected, already filled

    Should I treat Presubmit-locate as a form of 'ACK' (IB state "submitted")?
     
  4. It's just another state that needs to be handled. It forces you to think about how long do you want to wait for a short to be located? After you cancel how long do you wait for an acknowlegement back? Maybe never (the Internet went down, whatever). I thought it was pretty silly have a handler for a timeout on a market order since they ALWAYS execute instantly but then one day there was a delayed open due to news and I was glad that handler was there.
     
  5. Maybe I should phrase this better. I'm trying to get a very specific answer to a very specific scenario -- i..e, the scenario I wrote in the thread earlier.

    In the above scenario I posted in a previous message, say I cancel my order once I detect it's in presubmit-locate. Should my internal accounting treat this order as an order that can be executed, given the fact that it's possible for me to send a cancel but for IB to have an Ack AND a Fill message in flight on the wire? <-- Key question.

    More descriptive:

    1) I send my cancel on my order in locate state, this message is going through the internet to IB. I have a shitty connection, so this order goes through China, then Iceland, then back through Los Angeles, through Detroit, and finally IB's server. (It's slow.)

    2) IB, on its servers, finds a locate. It sends me a submit AND it puts my order out on the market. As soon as it puts my order into the market, the market cuts through my level and fills my order, sending IB a fill message (who then forwards that notification on to me).

    At this point in time, the "Submit" is already in flight and the "Fill" is in flight afterwards. Now, my cancel-order from (1) finally hits IB's server.

    3) IB sees that my order was already filled, so it rejects the cancel. Sends me another notification.

    So, for all intents of purposes, should I consider a notification that my order is in a 'locate' state as just another form of "Submitted", but more informational?

    I hope this makes sense.

    Thanks for your help, btw.
     
  6. sprstpd

    sprstpd

    Yes.
     
  7. Word.

    Thanks.