I'm wondering what happens in the Exchange queue when I change the quantity of a limit order.
In NT if order quantity is 1 a new order is sent when the quantity is changed. So at the exchange the first order does not loose its place in the queue.
But what happens if I change the quantity from 3 to 2?
Are the 3 contracts are canceled in the queue and 2 are appended at the last place?
Or is simply 1 contract deleted from the order and it stays at its place in the queue?
Why is FIFO important?
FIFO is important since getting your orders filled is dependant on a FIFO algorithm which basically means orders submitted ahead of yours at your order's price level will get filled ahead of you. Think of it like a long line at the grocery store. You are checked out only when those in line ahead of you have been checked out. NinjaTrader preserves your place in line when possible giving you the best possible advantage of getting your orders filled.
How does NinjaTrader preserve FIFO?
All NinjaTrader order entry interfaces simplify the visualization of orders. Let's say that you have a buy limit order for 1 contract, and then want to modify this order from 1 contract to 2 contracts. Most other programs will simply change this order directly, but behind the scenes (at the broker's order servers) what is really happening is that the original order is cancelled (removed from the line) and then a new order for 2 contracts is submitted which then goes to the back of the line putting you at a disadvantage. Imagine waiting in the grocery store check out line for ten minutes. You forgot to get some bread, you leave the line in order to get the bread that you wanted (changing your order) and upon your return to the check out line, you have to start at the back of the line and wait all over again! With NinjaTrader, when you modify the order from 1 contracts to 2 contracts, an additional order for 1 contract is submitted. Now you have the original order for 1 contract waiting in the middle of the line somewhere and the new order for 1 contract at the back of the line. Your original order is not penalized and you maintain your position in line. The opposite is true for decreasing an order size. Although there are two working orders NinjaTrader consolidates the display so it looks as if there is only one order working. You decide to decrease the order size from 2 contracts back to 1. NinjaTrader will modify the newest orders first and the oldest orders last in order to preserve your FIFO status. Following our example, the second order that was placed would be cancelled and you would be left with the original order for 1 contract with its maintained position in the order queue.
Matching orders in orders queue depends on exchange an products. We are interested in place in the order queue on the exchange server because we are interested in the probability of filling our limit order. A related term is "matching algorithm". Each exchange has different matching algorithms for different products. The most common algorithms are FIFO and Pro-Rata. Basic description of the matching algorithms on CME can be found here: http://www.cmegroup.com/confluence/display/EPICSANDBOX/Matching+Algorithms