Registered: Apr 2012
11-19-12 05:12 PM
Quote from johnny_no_lots:
sma202 and monstimal: thank you both for your responses.
Subsequent to my post, I modified my simulator to execute trades exactly as the ITCH feed specified. The three general classes of ITCH messages -- adds, cancels, and executes -- all have order id's associated with the message. By hitting the order by the exact id, rather than just submitting it to my limit order book, all errors were resolved. (It wasn't just mismatched executions -- it was also failures to delete, given already hit orders.)
At this point, my reconstruction identically reproduces the ITCH feed, but I'm still not sure exactly why the executes are out of order. Perhaps it is due to what sma202 mentioned -- executed orders are not immediately reported. In that case, I have to do some research to see how this is handled on Nasdaq's side. If an order placed on the NASDAQ books is executed with a delayed notice, how does NASDAQ know not to execute it against other orders?
I suspect that monstimal is right -- I failed to integrate certain order types that NASDAQ provides such as post-only . I have read more up on their order types.
Yeah, I'm confused, too. I just got a similar file from TradingPhysics, and set up a simulation. My problem is that I have executions against orders which are not BBO, but sitting further back in the queue. Something like, I get order 1 submitted at price X, then a bunch of orders, then order 2. Order 2 is sitting near the back of the queue. Then, it gets executed against. Some *400 seconds* later, order 1 gets executed. Anybody, including OP, have any light to shed on this? Looks like a violation of price-time priority, which can't be right.