Skip to content

🔎 Limit orders and how modern markets actually work

How modern stock markets actually work: Limit Orders, Auction Markets, and Stop Loss Orders (applies to stock, option, and futures markets)

Understanding how Limit Orders, Market Orders, and Stop-Loss Orders interact on Auction Markets is crucial for understanding the major exchanges like NYSE and NASDAQ as well as the ECNs and even some of the Dark Pools. It’s also crucial for understanding when your own order will get filled.

The bottom line of this page is that auction markets match buyers and sellers and choose a price at which transactions happen. This choice of price is known as “price discovery.” When doing homework for options or futures, students often ask where the prices come from. I won’t have time to explain it then, but the answer is that it comes from the interaction of limit orders and market orders, exactly like on this page. Therefore, if you understand how orders interact on an auction market, Options and Futures will make more sense as you do future assignments.

Limit Orders:

Limit buy order: Buyer Bob submits the following instructions to his broker: “Please help me to buy 100 shares of TSLA. I won’t pay more than $1085 per share.” (←1085 is the “limit” for your buy order. It is the highest price you are willing to pay.)

Limit sell order: Selma Sales submits the following instructions to her broker: “Please help me to sell 100 shares of TSLA. I won’t accept less than $1086 per share.” (←1086 is the “limit” for your sell order. It is the lowest price you are willing to receive.)

Market Order:

Market Buy Order: You submit the following instructions to your broker: “Please help me to buy 100 shares of TSLA. Please find the lowest price you can, but I will accept the best price you find. Basically, give me the ‘market price’ for the stock.”

Market Sell Order is similar.

❔ Wait… for the buy order, the limit was 1085, but for the sell order, the limit was 1086. Why?

See answer

✔ Great observation. Selma and Bob are both submitting their orders to the exchange. Is there any way for the exchange to match Selma and Bob up to trade with each other? The answer is NO. Bob wants to buy for $1085 or less. Selma wants to sell for $1086 or more. There is no price that will make them both happy. They are a mismatch. At this point, Selma and Bob’s orders will “rest” on the market, waiting until another comes in that they can be matched with (see Player 3, below). They will be added to a database called the exchange’s “limit order book.” At the end, I will show you how to visualize the limit order book.

❔ Suppose Mark Market enters the market and submits a market buy order for 100 shares at this point. For concreteness assume that there are only a total of 3 investors in the market right now: Bob, Selma, and Mark. Can Mark be matched up with Bob or Selma? And at what price?

See answer

✔ Mark instructed his broker to buy at the best price the broker can find on the market. The only person who wants to sell is Selma, so her price is automatically the best price on the market. Therefore, the exchange will match Player 3 up with Selma at a price for $1086 per share.

Both Selma and Player 3 will immediately have their orders “filled” by the computers at the exchange. Player 3 will buy Selma’s shares for $1086.

This is fundamentally how an auction-style exchange works. Whenever you buy or sell a stock or an option on an exchange, your trade is processed like this.

Whenever you trade on a market, if your order is immediately filled, then you were matched with a Bob or a Selma who had a limit order “resting” on the books of the exchange. Therefore, knowing about how many Bobs and Selmas are out there is very important. This data is highlighted in trading software:

The above says that for TSLA, the last trade that was executed (perhaps by Mark) was at $207.47. Currently, Buyer Bob is “Bidding” $208.95 to purchase new shares. Seller Selma is Asking for $209.05 to sell you shares. Bob and Selman can’t do business because the prices don’t cross. However, you could enter a market order and be matched with one of them.

❔ If you wanted to buy the shares right now, how much would you pay? How much would you pay if you wanted to sell them?

See answer

✔ If you want to buy the shares, you always “buy at the ask.” This is because you need to find a seller to trade with, and the best price being asked is $209.05. Therefore, if you submitted a market buy order, you would pay $209.05.

Similarly, if you want to sell the shares, you always “sell at the bid.” This is because you need to find a buyer, and the best buyer is only bidding $208.95. If you submitted a market sell order, you would receive $208.95.

Note: this is the big idea, but there is additional complexity. For example, the bid and ask prices are constantly changing, so by the time you press enter, they may have changed.

There are likely many other limit orders resting in the market other than Bob and Selma’s orders. However, only the “best” offer are listed in a quote like the above table. These are known as the “top of the book.”

The bid and Ask listed above are the “top of book” resting limit orders:

The difference between the bid and ask is known as the “spread.” It’s an indication of how much it costs to trade the stock. For TSLA right now, the spread is $209.05$208.95=$0.10.\$209.05-\$208.95=\$0.10. This means that you can buy the stock and turn around and sell it and if the bid and ask don’t change, you will only pay $.10 for the round trip.

Profit for selling short=PsoldPbuy  back=AskBid=$209.05$208.95=$0.10\begin{aligned} \text{Profit for selling short} &= P_{sold} - P_{buy \;back} \\ &= \text{Ask} - \text{Bid} \\ &= \$209.05 - \$208.95 \\ &= \$0.10 \end{aligned}

That’s amazing! Your broker doesn’t charge you a fee and legally must execute your trade within the “National Best Bid/Offer” (NBBO). This protection is provided by the SEC’s “National Market System.” This also prevents “payment for order flow” (PFOF) from being a huge problem.

❔ When I submit an order, how do I know if it will immediately be filled?

See answer

✔ As we can see from the example above, a limit order may or may not be immediately filled. For example, Selma’s sell order wasn’t filled. Bob’s buy order was already resting on the market, but Selma’s and Bob’s price limits didn’t cross, so both orders had to rest on the market’s limit order book.

However, if Selma had accepted a lower selling price, submitting a limit sell order at $1085, the exchange would have matched her order up with Bob’s order. The two traders would have both had their orders filled at the price of $1085.

As we saw with Mark, market orders will be filled immediately if there are any resting limit orders for them to be matched with. For example, because Selma had a resting limit sell order, Mark’s order was immediately filled. Likewise if Marlene submitted a market sell order, her order could immediately be matched with Bob’s resting limit buy order.

Bottom line: by understanding how auction markets work, you can verify that limit orders may or may not be immediately filled, depending on how stringent their limit price is. Market orders will typically be filled if there are any resting limit orders (and there typically are very many).

❔ Wait, when you describe submitting an order, it sounds like you’re on the phone with a broker, but very few people do that these days.

See answer

✔ This is what it looks like on ThinkOrSwim from TDAmeritrade…

This is how Buyer Bob would submit his limit buy order:

Market buy orders are submitted like this:

❔ What is the difference between a limit sell order and a stop loss order?

See answer

✔ A limit sell order says that I want to sell my 100 TSLA shares right now (it’s just I demand to receive $1086 or more for each share). In contrast, a stop loss order says that I only want to sell my TSLA shares if the market price of TSLA gets below some trigger.

For example, suppose I think that TSLA will go up, but I’m not sure. I want to buy TSLA, but I want to protect my money. Suppose I have purchased shares with a limit or market order. What if the share price drops? A stop loss order allows me to tell my broker, “hey, if I’m wrong about TSLA going up, and if the price of TSLA goes below $1000, get me out. Specifically, submit a market sell order to liquidate my shares. In other words, if the share price goes below $1000, sell my shares for the best price you can find out on the market. Stop my losses at $1000.

↑↑ Stop losses are a great way to hedge your bets and manage your risks. Much of trading is about avoiding big losses, and stop orders can help with that.