If I put in a limit order for the same price and size as someone else, which order goes through?
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. While littleadv's answer is true for many exchanges (in particular the stock market, it's called FIFO matching) you should also know that some markets trade pro rata.  That is, for a match at some price level everyone at that level gets a chunk of the deal proportional to their input (i.e. order size). E.g. match for quantity X at a price level and passive side orders y1, y2; the order y1 would get y1 / (y1 + y2) of X and y2 would get y2 / (y1 + y2)  (for X = min(X, y1 + y2)).
"For every buyer there is a seller. That rule refers to actual (historical) trades. It doesn't apply to ""wannabees."" Suppose there are buyers for 2,000 shares and sellers for only 1,000 at a given price, P. Some of those buyers will raise their ""bid"" (the indication of the price they are willing to pay) above P so that the sellers of the 1000 shares will fill their orders first  (""sold to the highest bidder""). The ones that don't do this will (probably) not get their orders filled. Suppose there are more sellers than buyers. Then some sellers will lower their ""offer"" price to attract buyers (and some sellers probably won't). At a low enough price, there will likely be a ""match"" between the total number of shares on sale, and shares on purchase orders." Limit orders are generally safer than market orders. Market orders take whatever most-favorable price is being offered. This can be especially dangerous in highly volatile stocks which have a significant spread between the bid and ask. That being said, you want to be very careful that you enter the price you intend into a limit order. It is better to be a bit slower at entering your orders than it is to make a terrible mistake like the one you mention in your question. "I assert that it's simply not possible for them to place an order that gets ahead of yours (the first step in ""sell it back to you at a higher price""). They only know your order was placed after it reaches the exchange and gets filled." It depends on how you place your stop order and the type of stop orders available from your broker. If you place a stop market order and the following day the stock opens below your stop your stock will be stopped out at or around the opening price, meaning you can potentially end up with quite a large gap. If you place a stop limit order, say you place your stop at $10.00 with a limit price of $9.90, and if the price opens below $9.90, say at $9.50, your limit sell order of $9.90 will be placed onto the market but it will not be executed until the price goes back up to $9.90 or above. The third option is to place a Guaranteed Stop Loss, and as specified you are guaranteed your stop price even if the price gaps down below your stop price. You will be paying an extra fee for the Guaranteed Stop Loss Order, and they are usually mainly available with CFD Brokers (so if you are in the USA you might be out of luck). If you are buying your order will be placed in Bid list. If you are selling your order will be placed in the Ask list. The highest Bid price will be placed at the top of the Bid list and the lowest Ask price will be placed at the top of the Ask list. When a Bid and Ask price are matched a transaction will take place and it will the last traded price. If you are looking to buy at a lower price, say $155.01, your Bid price will be placed 3rd in the Bid list, and unless the Ask prices fall to that level, your order will remain in the list until it trades, it expires or you cancel it. If prices don't fall to you Bid price you will not get a trade. If you wanted your trade to go through you could either place a limit buy order closer to the lowest Ask price (however this is still not a certainty), or to be certain place a market buy order which will trade at the lowest Ask price. Yes, orders like this are very possible.  There are nearly endless possibilities for structuring a trade.  It all comes down to whether you have the money to make the trade at the find you find a counterparty.  If you don't, the order is cancelled. Trades like this happen all day long at Goldman, BAML, Merril, UBS, etc.  And on eBay. Actually the insertion part is interesting because they actually aren't middlemen just faster buyer's and sellers on the open market. They just buy what one person is selling and sell it to someone else who is at the same time looking to buy. So I guess the issue is the 'same time' isn't the same for all parties concerned. On the other hand both buyer and seller can set limits on the bounds of the price and only transact when someone meets their terms. If you are willing to accept 'whatever the market will bear' then it seems like you should be OK with getting it. I normally just do a buy limit at the price I want to buy it at. Then it executes when it's that price or lower, but there's still a chance you might purchase some shares at a larger price. But since we're small fry and using brokerages, there's not much we can do about it. Yes for every order there is a buyer and seller. But overall there are multiple buyers and multiple sellers. So every trade is at a different price and this price is agreed by both buyer and seller. Related question will help you understand this better. How do exchanges match limit orders? "You will almost certainly be able to sell 10,000 shares at once. The question is a matter of price. If you sell ""at market"" then you may get a lower price for each ""batch"" of the stock sold (one person buys 50, another buys 200, another buys 1000 etc) at varying prices. Will you be able to execute a single order to sell them all at the same price at the same time? Nobody can say, and it's not really a function of the company size. The exchange has what's called ""open interest"" which roughly correlates to how many people have active orders in at a given price. This number is constantly changing alongside the bid and ask (particularly for active stocks). So let's say you have 10,000 shares and you want to sell them for $100 each. What you need is at least 10,000 in open interest at $100 bid to execute. By contrast let's say you issue a limit order at $100 for 10,000 shares. Your ask will stay outstanding at that price and you'll be filled at that price if there are enough buyers. I you have a limit sell order at $100 for 10,000 shares the strike price of the stock cannot go to $100.01 until all of your sell orders are filled." The Limit Order are matched based on amount and time. The orders are listed Highest to Lowest on the Buy Side. The orders are listed Lowest to Highest on the Sell Side. If there are 2 Sell orders for same amount the order which is first in time [fractions of milliseconds] is first.  The about is the example as to how the orders would look like on any exchange.  Now the highest price the buyer is ready to pay is 20.21 and the lowest price a seller is ready to sell for is 20.25. Hence there is no trade. Now if a new Buy order comes in at 20.25, it matches with the sell and the deal is made. If a new Buy order comes in at 20.30, it still matches at 20.25. Similarly if a Sell order come in at 20.21, it matches and a deal is made. If a Sell order come in at 20.11, it still matches 20.21.   Incase of market order, with the above example if there is a Buy order, it would match with the lowest sell order at 20.25, if there is not enough quantity , it would match the remaining quantity to the next highest at 20.31 and continue down. Similarly if there is a Sell market order, the it would match to the maximum a seller is ready to buy, ie 20.21, if there is not sufficient buy quantity at 20.21, it will match with next for 20.19   If say there are new buy order at 20.22 and sell orders at 20.24, these will sit first the the above queue to be matched. In your above example the Lowest Sell order was at 20.10 at time t1 and hence any buy order after time t1 for amount 20.10 or greater would match to this and the price would be 20.10. However if the Buy order was first ie at t1 there was a buy order for 20.21 and then at time later than t1, there is a sell order for say 20.10 [amount less than or equal to 20.21] it would match for 20.21. Essentially the market looks at who was the first to sell at lower price or who was the first to buy at higher price and then decide the trade.  Edit [To Clarify xyz]: Say if there is an Sell order at $10 Qty 100. There is a buyer who is willing to pay Max $20 and is looking for Qty 500. Your key assumption that the Buyer does not know the current SELL price of $10 is incorrect. Now there are multiple things, the Buyer knows the lowest Sell order is at $10, he can put a matching Buy order at $10 Qty 100, and say $11 Qty 100 etc. This is painful. Second, lets say he puts a Buy order at $10 Qty 100, by the time the order hits the system someone else has put the trade at $10 and his order is fulfilled. So this buyer has to keep looking at booking and keep making adjustments, if its a large order, it would be extremely difficult and frustrating for this Buyer. Hence the logic of giving preference. The later Buy order says ... The Max I can pay is $20, match eveything at the current price and get the required shares. The next day the market opens trading at 10.50, You haven't specified whether you limit order for $10.10 is to buy or sell. When the trading opens next day, it follows the same process of matching the orders. So if you have put a limit order to buy at $10.10 and there is no sell order at that price, your trade will not go through. If you have placed a limit sell order at $10.10 and there is a buyer at or higher price, it would go through. The Open price is the price of the first trade of the day. As you probably know, a credit spread involves buying a call (or put) at one strike and selling another call (or put) at another with the same maturity, so you're dealing with two orders. Your broker will likely have to fill this order themselves, meaning that they'll have to look at the existing bid/asks for the different strikes and wait until the difference matches (or exceeds) your limit order.  Obviously they can't place limit orders on the legs individually since they can't guarantee that they will both be executed.  They also don't care what the individual prices are; they just care what the difference is.  It's possible that they have computer systems that examine existing bids and asks that would fill your order, but it's still done by the broker, not the exchange.  The exchange never sees your actual limit order; they will just see the market orders placed by your broker. "You might consider learning how the ""matching"" or ""pairing"" system in the market operates.  The actual exchange only happens when both a buyer and a seller overlap their respect quotes.   Sometimes orders ""go to market"" for a particular volume.  Eg get me 10,000 Microsoft shares now.  which means that the price starts at the current lowest seller, and works up the price list until the volume is met.  Like all market it trades, it has it's advantages, and it's dangers.  If you are confident Microsoft is going to bull, you want those shares now, confident you'll recoup the cost.  Where if you put in a priced order, you might get only none or some shares. Same as when you sell.  If you see the price (which is the price of the last completed ""successful"" trade.  and think ""I'm going to sell 1000 shares"". then you give the order to the market (or broker), and then the same as what happened as before.  the highest bidder gets as much as they asked for, if there's still shares left over, they go to the next bidder, and so on down the price... and the last completed ""successful"" trade is when your last sale is made at the lowest price of your batch. If you're selling, and selling 100,000 shares. And the highest bidder wants 1,000,000 shares you'll only see the price drop to that guys bid.  Why will it drop (off the quoted price?).  Because the quoted price is the LAST sale, clearly if there's someone still with an open bid on the market...then either he wants more shares than were available (the price stays same), or his bid wasn't as high as the last bid (so when you sale goes through, it will be at the price he's offering).   Which is why being able to see the price queues is important on large traders. It is also why it can be important put stops and limits on your trades, een through you can still get gapped if you're unlucky.  However putting prices (""Open Orders"" vs ""(at)Market Orders"") can mean that you're sitting there waiting for a bounce/spike while the action is all going on without you). safer but not as much gain (maybe ;) ) that's the excitement of the market, for every option there's advantages...and risks... (eg missing out) There are also issues with stock movement, shadowing, and stop hunting, which can influence the price. But the stuff in the long paragraphs is the technical reasons." What you have to remember is that Options are derivatives of another asset like stocks for example.  The price of the Option is derived from the price of the underlying. If the underlying is a stock for example, as the price of the stock moves up and down during the trading day, so will the Market Maker's fair value for the Option.  As Options are usually less liquid than the underlying stock, Market Makers are usually more active in 'Providing a Market' with Options. Thus if you place a limit order half way between the current Bid and Ask and the underlying stock price moves towards your limit order, the Market Maker will do their job and 'Provide a Market' at that price, thus executing your order.