Limit Order Execution
A limit order allows you to guarantee that, if a trade is possible, you will receive a specified price (limit price) or better.
Limit Order Scenario 1
You place a buy limit order with a limit price of $18.50 for XYZ. You are willing to buy XYZ if the price drops to $18.50 or lower. You see the ask price listed at $18.50, and you see other trades executing for $18.50, but your order never triggers. What happened?
Much like market orders, limit orders 'wait in line' to be executed. Think about the market like the grocery store. There are several different check-out lines available, and you need to choose one. In the market, there are also many different check-out lines, called market makers, who match buy and sell orders.
When you place an order, your order is routed to a single market maker, who will try to match your buy order with a seller, and vice versa. Sometimes, one market maker will be able to match a seller and a buyer at a particular price while another will not. It all depends what orders are in their queue. If there are no sellers willing to sell at your limit price of $18.50 or better, then your order cannot be executed.
Limit Order Scenario 2
You place a sell limit order for your 50 shares of XYZ with a limit price of $26.75. You are willing to sell your shares of XYZ for $26.75 or higher. XYZ briefly reaches $27, and your limit order executes, but only 35 of your shares were sold. What happened?
Unless you specify AON (all or none) when you place your order, then it is possible for your order to only partially execute. AON means you only want your order to execute if the whole order can be filled at the same price at the same time. Investors will typically use AON on a sell order if they either want to sell all the shares in the order for a profit, or hold onto all of the shares.
If AON is not specified, then it's possible to get a partial execution of your order, as you see in this scenario. Here, what likely happened is that because the market moved so quickly, there were not enough buyers at $26.75 or better for all 50 shares to be sold.