Skip to content

How the Stock Market Works: Exchanges, Brokers and the Price of a Trade

What happens between pressing buy and owning a share: brokers, exchanges, market makers, how prices form from bids and asks, and when a trade settles.

By Published 3 min read

Reign Creative LLC makes Learn to Trade Stocks Beginner, which this article links to, so we have a commercial interest in it. How we write and check articles.

AI-assisted article. Drafted with AI tools from the sources cited below and checked by automated tests and an AI editorial review. No person has reviewed it yet. How we write and check articles.

Key takeaways

  • Companies raise money by selling shares in the primary market, such as an IPO; afterwards investors trade those shares with each other in the secondary market.
  • Individual investors do not connect to an exchange directly: a broker routes the order to an exchange, a market maker, an electronic network or its own inventory.
  • Prices are set by the orders of buyers and sellers; the quote shows the best bid and ask, and a market order fills at or near them, not necessarily at the last traded price.
  • Brokers have a duty to seek the best execution reasonably available for customer orders.
  • Most US stock trades settle one business day after the trade date, the T+1 cycle that took effect in May 2024.

Pressing "buy" in a trading app feels instant, as if you were plugged straight into the market. You are not. Investor.gov, the SEC's investor education site, makes the point bluntly: many investors who trade online assume they have a direct connection to the securities markets, but they don't. Between your tap and your shares sits a chain of firms, rules and prices, and knowing the chain explains most of what you see on a trading screen.

Two markets: where shares are born and where they change hands

Wikipedia's article on the secondary market draws the distinction:

  • The primary market is the initial sale of a security by its issuer, such as shares sold in an initial public offering; the proceeds go to the issuer.
  • The secondary market is all the trading after that, where one investor sells to another, with little impact on the company that issued the shares.

Wikipedia names stock exchanges such as the New York Stock Exchange and Nasdaq as the most visible secondary markets, and they are the subject of the rest of this guide.

The cast

Participant Role
You Decide what to buy or sell and what kind of order to use
Broker Holds your account, takes your order and decides where to send it
Exchange A regulated marketplace, such as the New York Stock Exchange or Nasdaq, that matches buy and sell orders
Market maker A firm that stands ready to buy or sell a stock at publicly quoted prices
Electronic communications network (ECN) A system that automatically matches buy and sell orders at specified prices
Regulators The SEC writes and enforces securities law; FINRA oversees broker-dealers

What happens to your order

According to Investor.gov, your broker may send your order to:

  1. The exchange where the stock is listed, or another exchange;
  2. A market maker, which may fill it from its own quotes;
  3. An ECN, especially for limit orders; or
  4. Its own inventory, a practice called internalisation.

Some market makers pay brokers for sending them orders, a practice called payment for order flow, which Investor.gov describes as perhaps a penny or more per share. Whatever route is used, brokers have a duty to seek the best execution reasonably available for their customers' orders, and to weigh the possibility of a better price against the extra time it might take.

How the price is set

There is no single official price for a stock. At any moment there is:

  • the bid, the highest price someone is currently willing to pay, and
  • the ask, the lowest price someone is currently willing to accept.

The gap between them is the bid–ask spread. A trade happens when a buyer and seller agree, and a headline "price" may simply be the last trade.

Investor.gov stresses two consequences. A market order generally executes at or near the current ask (for a buy) or bid (for a sell), and the last-traded price is not necessarily the price a market order will get. And because quotes cover only a specific number of shares and prices move, you may not receive the price you saw on screen. That is the whole case for choosing an order type deliberately, the subject of market orders versus limit orders.

Wikipedia's article on market trends sums up what sits behind every price change: the price of an asset such as a stock is determined by supply and demand.

When the trade actually completes

Execution is not the end. The trade must settle: cash and shares must actually change hands. FINRA explains that, as of May 2024, the standard settlement cycle for most US securities is the next business day after the trade, T+1. Sell on Tuesday and the trade settles on Wednesday. T+1 settlement explains why that date matters, especially in a cash account.

When the market is open

The New York Stock Exchange's core trading session runs from 9:30 a.m. to 4:00 p.m. Eastern Time on business days, with early and late sessions on some of its markets and closures on market holidays. Trading outside the core session works differently and carries its own risks, covered in stock market hours.

Seeing it in practice

Reading about order routing is abstract until you place orders and watch them fill. Learn to Trade Stocks Beginner lets you practise market, limit and stop orders with a virtual balance and see positions and profit and loss update, though, as a simulator, it cannot reproduce real routing or real fills. It is one of our education apps, and the investing basics hub lists the related guides, starting with what a stock is.

Good to know

Frequently asked questions

How does the stock market work, simply?
It is a set of venues where buyers and sellers of shares meet. You place an order with a broker, the broker sends it to a venue such as an exchange or a market maker, it is matched with an order on the other side, and the trade settles a business day later, when the cash and shares change hands.
Who sells me the shares when I buy?
Another investor or a firm, not the company. After a company's initial sale of shares, its stock trades between investors in the secondary market. A market maker may take the other side of your trade, standing ready to buy or sell at quoted prices.
Why didn't I get the price I saw on the screen?
Quotes apply to a limited number of shares and prices can change between your order and its execution, especially in fast markets. Investor.gov notes the last traded price is not necessarily the price a market order will get. A limit order caps the price you pay, at the risk of not being filled.
What is payment for order flow?
A payment some market makers make to brokers for routing customer orders to them, described by Investor.gov as perhaps a penny or more per share. Brokers that accept it still have a duty to seek the best execution reasonably available for their customers.

Sources

  1. Executing an Order (opens in a new tab)Investor.gov, U.S. Securities and Exchange Commission — accessed
  2. Types of Orders (opens in a new tab)Investor.gov, U.S. Securities and Exchange Commission — accessed
  3. Understanding Settlement Cycles (opens in a new tab)FINRA — accessed
  4. Holidays and Trading Hours (opens in a new tab)New York Stock Exchange — accessed
  5. Secondary market (opens in a new tab)Wikipedia — accessed
  6. Market trend (opens in a new tab)Wikipedia — accessed

About the author

— The independent app studio that builds the apps covered on this site and publishes every article here. On Google Play it publishes as Reign Collective Apps.

We use AI tools to help research, draft and edit our articles. Each article lists the sources its factual claims rely on, and details about our apps come from their live Google Play listings. No article on this site has been reviewed by an independent expert unless the reviewer is named on it.

No person at Reign Creative LLC has read this article in full. It was published after automated checks and an AI editorial review, which are described in our editorial policy and are not the same as a person reading every sentence.

Spotted an error? Tell us — how corrections are handled is set out in our editorial policy.