Order Books, Market and Limit Orders: How Is a Stock Purchase Actually Executed?
You clicked “Buy” in your investment app. What happens now?
- Reading time
- 10 minutes
- Complexity
- Intermediate
- Last updated
It is easy to think that we simply buy a stock directly from the exchange, like a product off a supermarket shelf at a predetermined price. In reality, the exchange is not a store, and a stock does not have a fixed price tag. For a trade to occur, interests must align: someone who wants to buy and someone willing to sell must agree on the same price.
To understand how the next price is determined, we need to look behind the scenes—at the order book.
What is an order book?
The order book is the exchange's digital bulletin board. It is where the buy and sell orders of investors who have not yet found a counterparty wait. The book is divided into two sides:
- Buyers (demand / Bid): offer prices and wait for someone to sell to them.
- Sellers (supply / Ask): specify asking prices and wait for someone to buy from them.
Suppose the order book for a particular stock currently looks like this:
Example of an order book
| Buyers (Bid) | Sellers (Ask) |
|---|---|
| Investor A is willing to buy at 100 ₪ | Investor C is willing to sell at 101 ₪ |
| Investor B is willing to buy at 99 ₪ | Investor D is willing to sell at 102 ₪ |
As long as the highest buyer offers 100 ₪ and the lowest seller asks 101 ₪, there is no match and therefore no trade occurs. The gap between them is called the bid-ask spread (Spread). Once a buyer agrees to pay 101 ₪, or a seller agrees to sell at 100 ₪, a new trade can occur and the price on the screen will update.
Two ways to act: market order versus limit order
To send an order into this book, you have two basic order types available, each with a different order of priority:
1. Market order (Market / MKT): "Buy for me now, at the price available in the market"
With a market order, you prioritize fast execution and forgo setting a price limit. You determine the number of shares, and the system buys them from available sellers, starting with the cheapest, according to trading rules.
How does it work? Let us returnThe profit (or loss) from an investment over a certain period, usually expressed as a percentage of the original amount invested. to our order book. Suppose the following sellers are waiting there:
- 50 shares at 101 ₪
- 100 shares at 102 ₪
What happens if you buy 120 shares?
If you send a market order to buy 120 shares, assuming the offers have not changed by the time of execution, your order will "eat" through the price levels one by one: 50 shares will be bought at 101 ₪, and the remaining 70 shares will be bought at 102 ₪. Your average price will be higher than the first seller's price.
2. Limit order (Limit / LMT): "I will buy, but not at any price"
With a limit order, you set the maximum price you are willing to pay when buying, or the minimum price you are willing to accept when selling.
The order can execute immediately if there are matching offers. Otherwise, it may wait in the order book, depending on its validity period and settings.
How does it work? If you sent a limit order to buy 120 shares at a maximum price of 101 ₪, assuming the offers in the example are still available:
- 50 shares will be purchased immediately at 101 ₪.
- The remaining 70 shares will remain waiting in the order book. They can be purchased at 101 ₪ or less if suitable supply becomes available before the order expires.
If the price remains above the limit until the order expires, the remaining shares will not be purchased.
What happens with partial execution and queues?
If you sent a limit order to buy 1,000 shares at a maximum price of 100 ₪, but only 200 shares are available to buy at that price or less, you may receive a partial execution. 200 shares will be purchased, and the rest will continue waiting, according to the order settings.
Perspective: Is a market order really dangerous?
Beginner investors sometimes have an exaggerated fear of market orders. It is important to put things in perspective: the risk of execution at a surprising price depends on the securityA general term for a tradable financial asset (such as a share, bond, or unit in a fund) that represents a right to an asset or to profits.'s LiquidityThe speed and ease with which money can be withdrawn from an investment and converted into cash in a bank account without significant penalties., the size of the order, and market conditions.
In large, liquid stocks and large, actively traded exchange-traded fundsA security traded on an exchange that tracks a particular index, allowing an investor to buy a "basket" of assets in a single transaction. tracking major indices, such as S&P 500An index composed of 500 of the largest and leading companies traded on U.S. stock exchanges., bid-ask spreads during regular trading hours tend to be small. When your purchase is small relative to the available supply, a market order will generally be executed quickly, at a price close to the available ask price at the time of execution.
However, there is no guarantee that the order will execute at the most recent trade price shown on the screen. It is important to check the available supply in the specific fund you are buying, rather than relying solely on the fact that it tracks a well-known index.
When should you be especially cautious with a market order?
The risk of execution at a poor and surprising price increases mainly in the following situations:
- Small stocks or thinly traded securities.
- Securities with a wide bid-ask spread.
- An order that is large relative to the quantity available at nearby prices.
- Unusual volatility, for example following an InterestThe "price of money" – the amount paid for the use of someone else’s money, as income to the depositor or as a cost to the borrower. announcement or a significant event.
- Around the market open, when prices may change rapidly relative to the previous close.
The exchange clock: continuous trading versus opening and closing
During continuous trading, buy and sell orders meet and execute continuously whenever a price match is created.
In opening and closing auctions, by contrast, orders accumulate ahead of the determination of a common price. The exchange sets a price according to the auction rules, aiming to match as large a quantity of buy and sell orders as possible, subject to price limits and other rules.
Orders that participate in an auction and are executed in it are executed at the price set in the auction. Not every order will necessarily be executed, and partial execution is also possible.
Trading phases and the ability to participate in an auction vary among exchanges and trading systems.
Can you send an order when the exchange is closed?
Yes, in some trading systems. For example, if you enter an order in the morning in Israel to buy a U.S. exchange-traded fund, the system can hold it for execution when regular trading opens.
- If the system allows MKT: the order will wait and may be executed at or after the open, based on available prices and according to the system's rules.
- If the system allows only LMT: you can set a maximum purchase price higher than the last displayed price. If, at execution, there are sellers at a price below the limit, you may buy at the lower price—not automatically at the price you entered.
For example, if the fund closed at 100 dollars and you entered a limit of 105 dollars, and the order participates in an opening auction that sets a price of 101 dollars, the portion executed in the auction will be purchased at 101 dollars, not 105 dollars.
In a very liquid stock or ETF, when the purchase is small relative to available supply and the limit permits it, execution is generally expected to be quick at the prices available in the market.
In a security with low Liquidity, by contrast, it is advisable to avoid entering a limit significantly higher than the last price just to ensure a purchase. There may be few shares for sale at nearby prices, and your order may also buy from more expensive offers, up to the limit you set. As a result, you could pay a price significantly higher than the price you saw on screen.
The checklist: a few seconds of review before you click
To reduce surprises, adopt a simple habit: before submitting an order, check the security's data and the order settings.
What should you check before submitting an order?
- What is the current ask price, and is the data displayed in real time?
- What is the bid-ask spread?
- Is there sufficient supply at nearby prices relative to the quantity I want to buy?
- Is this a liquid, tradable security?
- Is fast execution more important to me, or is limiting the price more important even at the cost of non-execution?
- If I chose LMT, is this a ceiling I am truly willing to pay?
- If regular trading is closed, will the order wait for the opening, or can it execute during extended hours?
- Is the order's validity appropriate, and has confirmation been received that it was accepted?
The bottom line
When you buy a stock, you send an order that must meet someone on the other side.
The order book displays buy and sell offers at different prices and quantities.
A market order prioritizes fast execution without setting a price limit.
A limit order sets a maximum purchase price or a minimum sale price. It can execute at a better price than the limit you set.
For liquid securities, a purchase that is small relative to available supply is generally expected to execute quickly at a price close to the available ask prices. The risk of a surprising price increases mainly when trading is thin, spreads are wide, or the order is large relative to the order book.
You can sometimes enter an order when trading is closed and wait for the opening. Check the order type, price limit, validity, and the trading hours for which it is intended.
Sources and links
- Tel Aviv Stock Exchange — Trading System — explanation of trading phases and the order execution mechanism.
- U.S. Securities and Exchange Commission — Order Types — explanation of market and limit orders and the difference between the last price and the execution price.
- U.S. Securities and Exchange Commission — Trade Order Execution — explanation of order routing and possible price changes before execution.
- Charles Schwab — Trading Outside Regular Hours — explanation of extended-hours trading, order types, and Liquidity limitations.
Article quality matters to us
Found an error, inaccurate information, or a detail that needs updating? We’d be glad to hear from you.
A new message will open in your email app.

