How are unmarketable market orders (other side of the order book is empty) matched with incoming orders? [duplicate]
I don't have all the answers. On a illiquid stock, such situations do arise and there are specific mechanisms used by exchanges to match the order. It is generally not advisable to use market order on illiquid stock. There are lots of different variations here. I guess this comes down to specifications for individual exchanges, but I'm wondering if there's a standard here or a way to approach it from basic rules that clears up all these situations. There are quite a few variations and different treatments. Market order that are placed when the market is closed or just around market opening are traded at Market Open price that each exchange has a formulae to calculate. In the process Market Buy are matched to Market Sell at the Exchange calculated price. Not all order get matched and there could be spill over's. These are then matched to limit orders. Is this determined based on which sell order came first, or based on which would result in the best deal for the incoming buyer? Generally Market orders have highest priority of execution.
In the stock market many participants enter orders that are not necessarily set at the current market price of the stock (i.e. they are not market orders, they are limit orders). They can be lower than the market price (if they want to buy) or they can be higher than the market price (if they want to sell). The set of orders at each point of time for a security is called the order book. The lowest selling price of the order book is the offer or ask, the higher buying price is the bid. The more liquid is a security, the more orders will be in the order book, and the narrower will be the bid-ask spread. The depth of the order book is the number of units that the order book can absorb in any direction (buy or sell). As an example: imagine I want to buy 100 units at the lowest offer, but the size of the lowest offer is only 50 units, and there is not any further order, that means the stock has little depth. "People must simply be willing to match your orders if they know about it. You can sniff orders out if you can see them or predict them. For instance, you can look at an order book and decide who you want to get filled at, especially if you are looking at different quotes from different exchanges. So you can get a ""better"" fill just by looking at what someone is willing to pay to enter/exit their order as well as what exchange they placed their order through, and send an order to that specific exchange to match them. You (or a program) can just watch the level 2's and place an order as soon as you see one you like. The orders on the level2's do not reveal ALL interested market participants. Also many brokers have difficulty updating options quotes. Finally, options & market volatility can inflate or decrease the price of options by large percentages very quickly." "What you are saying is a very valid concern.  After the flash crash many institutions in the US replaced ""true market orders"" (where tag 40=1 and has no price) with deep in the money limit orders under the hood, after the CFTC-SEC joint advisory commission raised concerns about the use of market orders in the case of large HFT traders, and concerns on the lack of liquidity that caused market orders that found no limit orders to execute on the other side of the trade, driving the prices of blue chip stocks into the pennies.  We also applaud the CFTC requesting comment regarding whether it is   appropriate to restrict large order execution design that results in   disruptive trading. In particular, we believe there are questions   whether it is ever appropriate to permit large order algorithms that   employ unlimited use of market orders or that permit executions at   prices which are a dramatic percentage below the present market price   without a pause for human review So although you still see a market order on the front end, it is transformed to a very aggressive limit in the back end. However, doing this change manually, by selling at price 0 or buying at 9999 may backfire since it may trigger fat finger checks and prevent your order from reaching the market.  For example BATS Exchange  rejects orders that are priced too aggressively and don't comply with the range of valid prices.  If you want your trade to execute right now and you are willing to take slippage in order to get fast execution, sending a market order is still the best alternative." But how does the quantity matching happen? For example, if I want to buy 1000 shares at $100, but there is only one seller to sell 10 shares at $100, what happens then? This depends on the type of order you've placed. If you placed a fill-or-kill order, your order to buy or sell a certain number of shares is routed to the trading floor for immediate execution. If the order cannot be immediately filled, it is cancelled (killed) automatically. Note that the order must be filled in its entirety. Partial fills are not allowed. In your example, your buy order wouldn't be filled because it couldn't be matched to a sell order of the same volume. This is similar to an all-or-none order, which is an order that contains  A condition instructing the broker to fill the order completely or not at all. If there is insufficient supply to meet the quantity requested by the order then it is canceled at the close of the market. In this case, if your order wasn't matched to an order of the same volume by the time the market closes, it's cancelled. If you simply placed a market/limit order, and (in the case of the limit order), part of your order was matched to another order with the right price, that part of your order will be filled, while the rest will remained unfilled. "My answer isn't a full one, but that's because I think the answer depends on, at minimum, the country your broker is in, the type of order you place (limit, market, algo, etc.,) and the size of your order. For example, I can tell from watching live rates on regular lot limit orders I place with my UK-based broker that they hold limit orders internally until they see a crossing rate on the exchange my requested stock is trading on, then they submit a limit order to that exchange.  I only get filled from that one exchange and this happens noticeably after I see my limit price print, and my fills are always better than my limit price. Whereas with my US-based broker, I can see my regular lotsize limit order in the order book (depth of book data) prior to any fills.  I will routinely be notified of a fill before I see the limit price print.  And my fills come from any number of US exchanges (NYSE, ARCA, BATS, etc.) even for the same stock. I should point out that the ""NBBO"" rule in the US, under SEC regulation NMS, probably causes more complications in handling of market and limit orders than you're likely to find in most countries." The one whose order gets to the exchange first. The exchange receives the orders and arranges them in First-In-First-Out order, by which they're then executed. At some point it is synchronized and put into a list. Whoever gets to that point first - gets the deal. In general stock markets are very similar to that, however, you can also put in limit orders to say that you will only buy or sell at a given price. These sit in the market for a specified length of time and will be executed when an order arrives that matches the price (or better). Traders who set limit orders are called liquidity (or price) makers as they provide liquidity (i.e. volume to be traded) to be filled later. If there is no counterparty (i.e. buyer to your seller) in the market, a market maker; a large bank or brokerage who is licensed and regulated to do so, will fill your order at some price. That price is based on how much volume (i.e. trading) there is in that stock on average. This is called average daily volume (ADV) and is calculated over varying periods of time; we use ADV30 which is the 30 day average. You can always sell stocks for whatever price you like privately but a market order does not allow you to set your price (you are a price taker) therefore that kind of order will always fill at a market price. As mentioned above limit orders will not fill until the price is hit but will stay on book as long as they aren't filled, expired or cancelled. Think of all the limit orders waiting in line, first organized by price, and then by the time the order was placed (earlier orders are closer to the front of the line).  In order for your buy order to trade, there must be no other limit orders of 10.01 or higher, or the sellers order would have matched with them instead. So once your order is filled, the price is 10.00, even if just for a millisecond, because there was a trade at 10.00, even though the price might go right back up after the trade. "This is a great question precisely because the answer is so complicated. It means you're starting to think in detail about how orders actually get filled / executed rather than looking at stock prices as a mythical ""the market"". ""The market price"" is a somewhat deceptive term. The price at which bids and asks last crossed & filled is the price that prints. I.e. that is what you see on a market price data feed. ] In reality there is a resting queue of orders at various bids & asks on various exchanges.  (source: Larry Harris. A size of 1 is 1H = 100 shares.) So at first your 1000H order will sweep through the standing queue of fills. Let's say you are trading a low-volume stock. And let's say someone from another brokerage has set a limit order at a ridiculous price. Part of your order may sweep through and part of it get filled at a ridiculously high price. Or maybe either the exchange or your broker / execution mechanism somehow will protect you against the really high fill. (Let's say your broker hired GETCO, who guarantees a certain VWAP.) Also people change their bids & asks in response to what they see others do. Your 1000H size will likely be marked as a human counterparty by certain players. Other players might see that order differently. (Let's say it was a 100 000H size. Maybe people will decide you must know something and decide they want to go the same direction as you rather than take the opportunity to exit. And maybe some super-fast players will weave in and out of the filling process itself.) There is more to it because, what if some of the resting asks are on other venues? What if both you and some of the asks match with someone who uses the same broker as you? Not only do exchange rules come into play, but so do national regulations. tl;dr: You will get filled, with price slippage. If you send in a big buy order, it will sweep through the resting asks but also there are complications." It looks more like someone is trying to pocket the spread.  The trades are going off at the bid then the ask (from what I can tell without any L1 and L2 data, but the spread could be bigger than what the prices show, since the stock looks pretty volatile given the difference between current price and VWAP...).  Looking through the JSE rule books I didn't find any special provisions on how they handle odd lots in their Central Order Book, but the usual practice in other markets is to display only round lot orders. So these 4 share orders would remain hidden from book participants and could be set there to trigger executions from those who are probing for limit orders. Or to make a market with very limited risk. In order to see whether you can buy or sell some given quantity of a stock at the current bid price, you need a counterparty (a buyer) who is willing to buy the number of stocks you are wishing to offload. To see whether such a counterparty exists, you can look at the stock's order book, or level two feed. The order book shows all the people who have placed buy or sell orders, the price they are willing to pay, and the quantity they demand at that price. Here is the order book from earlier this morning for the British pharmaceutical company, GlaxoSmithKline PLC.  Let's start by looking at the left-hand blue part of the book, beneath the yellow strip. This is called the Buy side. The book is sorted with the highest price at the top, because this is the best price that a seller can presently obtain. If several buyers bid at the same price, then the oldest entry on the book takes precedence. You can see we have five buyers each willing to pay 1543.0 p (that's 1543 British pence, or £15.43) per share. Therefore the current bid price for this instrument is 1543.0. The first buyer wants 175 shares, the next, 300, and so on. The total volume that is demanded at 1543.0p is 2435 shares. This information is summarized on the yellow strip: 5 buyers, total volume of 2435, at 1543.0. These are all buyers who want to buy right now and the exchange will make the trade happen immediately if you put in a sell order for 1543.0 p or less. If you want to sell 2435 shares or fewer, you are good to go. The important thing to note is that once you sell these bidders a total of 2435 shares, then their orders are fulfilled and they will be removed from the order book. At this point, the next bidder is promoted up the book; but his price is 1542.5, 0.5 p lower than before. Absent any further changes to the order book, the bid price will decrease to 1542.5 p. This makes sense because you are selling a lot of shares so you'd expect the market price to be depressed. This information will be disseminated to the level one feed and the level one graph of the stock price will be updated. Thus if you have more than 2435 shares to sell, you cannot expect to execute your order at the bid price in one go. Of course, the more shares you are trying to get rid of, the further down the buy side you will have to go. In reality for a highly liquid stock as this, the order book receives many amendments per second and it is unlikely that your trade would make much difference. On the right hand side of the display you can see the recent trades: these are the times the trades were done (or notified to the exchange), the price of the trade, the volume and the trade type (AT means automatic trade).  GlaxoSmithKline is a highly liquid stock with many willing buyers and sellers. But some stocks are less liquid. In order to enable traders to find a counterparty at short notice, exchanges often require less liquid stocks to have market makers. A market maker places buy and sell orders simultaneously, with a spread between the two prices so that they can profit from each transaction. For instance Diurnal Group PLC has had no trades today and no quotes. It has a more complicated order book, enabling both ordinary buyers and sellers to list if they wish, but market makers are separated out at the top. Here you can see that three market makers are providing liquidity on this stock, Peel Hunt (PEEL), Numis (NUMS) and Winterflood (WINS). They have a very unpalatable spread of over 5% between their bid and offer prices. Further in each case the sum total that they are willing to trade is 3000 shares. If you have more than three thousand Dirunal Group shares to sell, you would have to wait for the market makers to come back with a new quote after you'd sold the first 3000. Fair value can mean many different things depending on the context. And it has nothing to do with the price at which your market order would be executed. For example if you buy market, you could get executed below 101 if there are hidden orders, at 101 if that sell order is large enough and it is still there when your order reaches the market, or at a higher price otherwise. "Market price is just the bid or offer price of the last sell or buy order in the market. The price that you actually receive or pay will be the price that the person buying the stock off you or selling it to you will accept. If there are no other participants in the market to make up the other side of your order (i.e. to buy off you if you are selling or to sell to you if you are buying) the exchange pays large banks to be ""market makers""; they fulfil your order using stocks that they don't want to either buy or sell just so that you get your order filled. When you place an order outside of market hours the order is kept on the broker's order books until the market reopens and then, at market opening time there is an opening ""auction"" at which orders are matched to opposing orders (i.e. each buy order will be matched with a sell) at a price determined by auction. You will not know what price the order was filled at until it has been filled. If you want to guarantee a price you can do so by placing a limit order that says not to pay more than a certain price for any unit of the stock." "This is a technical term referring to the ""double entry""-styled book keeping of trades by brokers. Suppose a client executes a buy order with their broker.  The broker's accounting for this ""trade"" will be recorded as two different ""deals"" : One ""deal"" showing the client as buyer and the broker as seller, and a second ""deal"" showing the broker as buyer and the clearing house as seller.  The net result of these two deals is that the broker has no net position while the client has a net buy and the clearing house has a net sell with respect to this broker's account as accounted for internally by the broker. (And the same methods apply for a client sell order.) The client/broker ""deal"" record - i.e., the client side of the trade - is called the ""client side booking"", while the broker/clearing house ""deal"" record is called the ""street side booking""." "Assuming you are executing your order on a registered exchange by a registered broker, your order will be filled at the best bid price available.  This is because brokers are legally obliged to get the best price available. For example, if the market is showing a bid of 49.99 and an offer of 50.01 and you submit an order to offer 1000 shares at 5.00, your order will be filled at 49.99.  This is assuming the existing bids are for enough shares to fill all of the 1000 shares being offered.  If the share you are offering lacks the necessary liquidity to fill the order - i.e., the 49.99 bid is for less than 1000 shares and the ""level two"" bids are not enough to fill the remaining shares, then the order would be posted in the market as an offer to sell the balance (1000 - shares filled at 49.99 and those filled at level two bids) at 5.00.   I'm pretty sure that the scenario you are describing would be described as market manipulation and it would be against the law."