The core idea
Every trade involves two things you might care about: whether the trade happens and what price you get. You cannot always guarantee both. Order types are the instructions that tell the market which of the two you value more.
- A market order says: "Trade now, at whatever the best available price is."
- A limit order says: "Trade only at this price or better."
That single difference explains almost everything else in this lesson.
Reading the quote first
Before placing any order, you need to read the quote. Take a hypothetical stock quoted at:
Bid 100.00 / Ask 100.10
- The bid (100.00) is the highest price a buyer is currently willing to pay. If you want to sell immediately, this is roughly where you sell.
- The ask (100.10) is the lowest price a seller is currently willing to accept. If you want to buy immediately, this is roughly where you buy.
- The gap, 0.10, is the spread. It is a real cost of trading immediately. For more on this, see our lesson on the bid-ask spread.
The numbers here are round and hypothetical, chosen only to illustrate the mechanics.
How a market order works
A market order is matched against the best opposing orders waiting in the order book. A buy market order takes the cheapest asks first; a sell market order takes the highest bids first.
If there is enough quantity at the best price, your whole order fills there. If not, it moves to the next price level, and then the next, until the full quantity is filled. This is sometimes called "walking the book".
What you get: near-certain execution. What you give up: control over the exact price.
How a limit order works
A limit order includes a price. For a buy, the limit is the maximum you will pay. For a sell, it is the minimum you will accept.
Two things can happen:
- The limit is marketable. If a buy limit is at or above the current ask, it executes immediately against the sellers, at the available price or better.
- The limit is not marketable. If a buy limit sits below the ask, it joins the order book as a resting order and waits. It fills only if sellers come down to your price. If the market moves away, it may never fill.
What you get: control over the worst price. What you give up: certainty that the trade happens.
Worked example: buying 500 shares
Imagine the hypothetical order book for the stock looks like this on the sell side:
| Ask price | Shares available |
|---|---|
| 100.10 | 200 |
| 100.15 | 200 |
| 100.30 | 400 |
You want to buy 500 shares.
Option A: market order
The order fills level by level:
- 200 shares at 100.10 = 20,020.00
- 200 shares at 100.15 = 20,030.00
- 100 shares at 100.30 = 10,030.00
Total cost: 50,080.00 for 500 shares, an average price of 100.16.
You got everything, immediately. But you paid above the quoted 100.10 because the first level could not satisfy the whole order. The extra cost compared with buying all 500 at 100.10 (50,050.00) is 30.00. This difference between expected and actual price is called slippage.
Option B: limit order at 100.10
You place a buy limit for 500 shares at 100.10.
- 200 shares fill immediately at 100.10 (cost 20,020.00).
- The remaining 300 shares rest in the book as a bid at 100.10.
Now the outcome depends on what the market does next:
- If sellers arrive at 100.10, you may complete the purchase at a good price.
- If the price drifts up to 100.40, your remaining 300 shares never fill. You hold 200 shares instead of 500 and have missed the move.
- If the price drifts down, you may fill the rest at 100.10 and then watch it fall further.
Option C: limit order at 100.20
You set a buy limit at 100.20, a little above the ask.
- 200 shares fill at 100.10 and 200 at 100.15.
- The third level (100.30) is above your limit, so the remaining 100 shares rest in the book at 100.20.
Your average price on the 400 filled shares is 100.125, and you never pay more than 100.20 per share. You gave up completeness of execution to protect yourself from the 100.30 level.
What the example shows
| Market order | Limit at 100.10 | Limit at 100.20 | |
|---|---|---|---|
| Shares filled immediately | 500 | 200 | 400 |
| Average price on filled shares | 100.16 | 100.10 | 100.125 |
| Worst price possible | 100.30 | 100.10 | 100.20 |
| Certainty of completing | High | Low | Medium |
The more you tighten the price, the less certain the fill. The more you insist on filling, the less certain the price.
The same logic when selling
Selling mirrors buying. A sell market order hits the bids, starting at 100.00 and moving down if size is large. A sell limit at 100.30 would rest in the book, waiting for a buyer willing to pay that much. If the stock never trades there, you remain a holder.
When each tends to make sense
These are general considerations, not instructions for any specific trade.
A market order may suit situations where:
- the asset is highly liquid, with a tight spread and deep book;
- the order is small relative to the quantity at the best price;
- completing the trade matters more than a few pennies of price.
A limit order may suit situations where:
- the spread is wide or the asset trades infrequently;
- you have a specific price you are unwilling to cross;
- the market is moving fast and quotes may be stale;
- you are comfortable with the possibility of not trading.
Common mistakes in thin markets
Thin markets have few buyers and sellers, so the order book is shallow and spreads are wide. This is where order type matters most.
Using a market order on an illiquid asset
Suppose a hypothetical small-company share is quoted at 50.00 / 51.00, with only 100 shares offered at 51.00 and the next offer at 53.00. A market order for 500 shares would fill 100 at 51.00 and the other 400 at 53.00 or higher. Your average price lands well above the quote you saw on screen. The spread was already 2 percent of the price before slippage began.
Trusting the last traded price
The last trade is history, not an offer. In a thin market, the last trade could have been hours ago at a very different level. Always read the current bid and ask.
Placing a market order outside normal trading hours
When few participants are active, quotes can be sparse and wide. A market order placed when the market is closed may be queued for the open, where the first price could differ sharply from the previous close. Rules vary by exchange and broker, so check how your platform treats such orders.
Setting a limit that is too ambitious and forgetting it
A buy limit far below the market may sit unfilled for days. If it later fills during a sudden drop, you may be buying in conditions you did not intend. Check whether your order is "day only" or remains active until cancelled, and review resting orders.
Assuming a limit order protects you from everything
A limit order protects the price per share. It does not protect you from the market moving against you after you are filled, and it does not guarantee you get your full quantity. Partial fills are common, and you may end up with a smaller position than planned.
Ignoring costs on both sides
A market order pays the spread and potential slippage. A limit order may avoid these, but the cost of missing the trade is real too. Neither is free; they are simply different costs.
Try this
Using the hypothetical quote Bid 99.90 / Ask 100.00, with this sell-side book:
| Ask price | Shares available |
|---|---|
| 100.00 | 300 |
| 100.05 | 300 |
| 100.20 | 500 |
- You place a market buy for 600 shares. Calculate the total cost and the average price per share.
- You instead place a limit buy for 600 shares at 100.05. How many shares fill immediately, at what average price, and what happens to the rest?
- In one sentence each, describe a situation where you would accept the outcome of order 1, and one where you would prefer order 2.
Check: for question 1, the 600 shares fill 300 at 100.00 and 300 at 100.05, costing 30,000 + 30,015 = 60,015, an average of 100.025. In question 2 the same fills occur, because both levels are within your limit, and nothing is left over. Now try changing the order size to 1,000 shares and see how the two orders diverge.
This is an educational exercise using invented numbers, not a suggestion to trade any particular security.