S&P 5007,659▼ 1.09%Nasdaq26,140▼ 2.15%Dow Jones52,002▼ 0.34%Nasdaq 10029,188▼ 2.50%VIX19.99▲ 21.45%US Dollar101.84▼ 0.21%Gold (GLD)382.01▼ 0.18%Oil (USO)161.76▲ 2.83%

How the stock market works: buyers, sellers and prices

18 October 20265 min readFinancial knowledge · lesson 2
How the stock market works: buyers, sellers and prices

The stock market is not one place but a network of exchanges and trading venues where buyers and sellers are matched to trade shares of public companies. Prices are not set by a committee. They emerge from the orders that people and institutions submit. Knowing how that process works explains why a stock has two quoted prices, why some stocks are harder to trade than others, and why your order may not fill at exactly the price you saw.

Two markets: primary and secondary

The primary market is where a company sells new shares to investors to raise money, for example in an initial public offering. The company receives the proceeds.

The secondary market is where investors trade existing shares with each other. When people say "the stock market," they usually mean this one. The company does not receive money when you buy its shares from another investor. Your trade simply transfers ownership from one holder to another.

How buyers and sellers meet

Most trading in US stocks is electronic. A buyer submits an order to buy, a seller submits an order to sell, and a computer system matches them according to fixed rules. Two prices matter:

  • The bid is the highest price someone currently offers to pay.
  • The ask (or offer) is the lowest price someone currently accepts to sell.

The gap between them is the bid-ask spread. Orders waiting at various prices form the order book. A trade happens when a buyer is willing to pay at least what a seller is willing to accept. The last trade price is what most websites show as "the price."

Example (illustrative numbers)

Suppose the order book for a stock looks like this:

Side Price Shares waiting
Ask $50.04 300
Ask $50.03 200
Bid $50.01 400
Bid $50.00 500

The best ask is $50.03 and the best bid is $50.01, so the spread is $0.02. If you submit a market order to buy 300 shares, you take the 200 shares at $50.03 first and the remaining 100 at $50.04. Your average price is slightly above the best ask. If you instead place a limit order to buy at $50.02, it sits in the book until a seller accepts that price. The difference between these order types is covered in market, limit and stop orders.

If a wave of buyers arrives and uses up the asks, the next buyers must pay higher prices, and the stock's price rises. Prices move because of the balance of orders, and that balance reflects what people think the company is worth.

Who is involved

  • Brokers give you access. You send your order to a brokerage, which routes it to a trading venue. Many US brokers do not charge a commission on stock trades, but they may be paid in other ways, such as for routing orders.
  • Exchanges such as the New York Stock Exchange and Nasdaq operate order books and set listing rules. See NYSE vs Nasdaq.
  • Other venues also match orders, including alternative trading systems and wholesale firms that fill retail orders directly. A US stock can trade on many venues at once, and regulations require brokers to seek good execution for customers.
  • Market makers stand ready to buy and sell, which keeps trading smooth. Their role is explained in market makers and high-frequency trading.
  • Clearing and settlement firms make sure the shares and cash actually change hands after the trade.

From order to ownership

When you press buy, the trade can execute in a fraction of a second. Settlement, the official transfer of cash and shares, takes longer. For most US stock trades it takes one business day after the trade, a standard known as T+1 (see trade settlement). You can usually see the position in your account right away, but the legal transfer completes later.

Trading hours

The regular US session runs from 9:30 a.m. to 4:00 p.m. Eastern time on business days. Many brokers also offer trading before the open and after the close, but fewer people take part then, so prices can be jumpier and spreads wider.

Common mistakes and limits

  • Assuming you will get the displayed price. The price on the screen is the last trade. Your order fills against the current bids and asks, which can differ, especially in fast markets or thinly traded stocks.
  • Ignoring liquidity. A stock with few buyers and sellers can have wide spreads and large price jumps on modest orders.
  • Thinking price equals value. A price is simply where supply and demand met a moment ago. It can be wrong in either direction for long stretches.
  • Believing someone must lose when you win. Trades happen for many reasons, including different time horizons, needs for cash and risk preferences.

Where to see it on StocksXray

The movers page is a place to see stocks with notable price moves, and each stock page shows price charts. StocksXray uses end-of-day data, so it is built for research rather than live order-book trading.

Key takeaways

  • Share prices emerge from the matching of bids from buyers and asks from sellers.
  • The primary market raises money for companies; the secondary market is where investors trade with each other.
  • Brokers, exchanges, market makers and clearing firms each play a role between your click and your ownership.
  • The price you see is the last trade, and your own fill can differ, particularly for less liquid stocks.
  • Regular US trading hours are 9:30 a.m. to 4:00 p.m. Eastern.

This article is educational and is not investment advice.

Related reading

Educational only, not financial advice. Examples use illustrative numbers.