I placed a limit sell order with a price of $11 on a stock yesterday, when the stock was trading at $10. Today, the price jumped up to $12 right at the open. I was worried my order would be filled at $11, but to my surprise, it was filled at $12. Can somebody explain the mechanism as to how this occurred? Was it because the order was submitted yesterday that helped me? What if I had placed the same order but after trading had already opened today at $12?
On many stock exchanges, a single-price auction (call auction) occurs at the open (and at the close). Every order executed at the open gets executed at the same price. On the NYSE, this auction is called an opening auction. On the NASDAQ, this auction is called the opening cross.
If your order was filled at the open, it would be filled at the opening price.
I've found it surprisingly hard to find information on exactly how the execution price of an order is determined. This is my understanding, based on my own experience and research, of what happens when you place a limit sell order for $x:
- If, at the time the order is processed, the highest limit buy order in the order book is $y, and y >= x, your order will execute at $y. In other words, since the person who placed the buy order did so before you placed your sell order, they "lose" (because they made their negotiation position public) and buy at their limit price while you get to sell at a higher price than your own limit.
- Otherwise (at the time the order is processed, there is no limit buy order in the order book with a price greater than or equal to your sell limit), your order ends up in the order book. The orders in the order book are ordered(!) first by price and then by submission time. At the time a buy order comes in, the first sell order in the order book (the one with the lowest price, and if several orders have the same lowest price, the first one among them that was submitted) gets priority:
- If the incoming order is a market order, it executes at $x.
- If the incoming order is a limit buy order for $y, and y >= x, your order will execute at $x. In other words, since you placed your sell order before the other person placed their buy order, you "lose" (because you made their negotiation position public) and buy at your limit price while they get to sell at a higher price than their own limit. Note that in this scenario, you are "the other person" in the first scenario.
- If your order goes unfulfilled in the course of the trading day (and was not set to expire at the end of the day), you will participate in the stock exchange's "opening auction" the following trading day. It is my understanding that they try to find an opening price that maximizes the volume of orders that can execute at the opening price. So if the opening price they determine happens to be higher than your sell limit price, your order will be executed at the opening price, even if it is higher than your limit.