liveBook · Manning

Bid-ask spread

As explained in Build a Robo-Advisor with Python (From Scratch)

A bid-ask spread is the difference between the highest price a buyer offers and the lowest price a seller accepts for a traded investment.

The bid–ask spread is the gap between the highest available bid and the lowest available ask for a traded asset. A buyer pays the ask; a seller receives the bid. The quoted price commonly shown by a brokerage is the mid price, halfway between those best prices, so it can obscure the immediate cost of trading. section 4.1.4

QQQ quote

If QQQ has a best bid of $285.14 and a best ask of $285.16, its spread is $0.02 and its mid price is $285.15. The displayed bid size of 1,300 shares and ask size of 1,200 shares identify the quantities available at those prices. section 4.1.4

Spread is a trading cost, not a brokerage commission. For an ETF round trip, trading cost is expected bid–ask spread multiplied by position size in shares; holding cost separately depends on holding period, expense ratio, and dollar position size. A low expense ratio therefore does not by itself make an ETF the lower-cost choice. section 4.3.1

Use the spread when making trading decisions:

  • Include it in the cost of frequent trades, alongside commissions and taxes; repeated trading can make this otherwise hidden cost significant. section 1.2.3
  • Compare similar ETFs on liquidity as well as index exposure and fees. A typical $0.09 spread for PBUS versus $0.03 for VTI raises the cost of trading the thinner fund. section 14.4.2
  • Treat a tax-loss-harvesting transaction as both a sale and replacement purchase, then compare its spread costs with the tax benefit of realizing the loss. section 14.3

A backtest can model the cost directly. Supply spreads as fractions of share prices, convert them to dollar spreads, and assume buys occur at current price plus half the spread while sells occur at current price minus half. This turns quoted prices into assumed executable prices and records the portfolio drag from rebalancing. section 13.4.2

Figure 4.1 Intraday market display for the QQQ ETF
figure

Inspect an intraday QQQ display to distinguish the mid price from the best bid, best ask, and available share quantities. section 4.1.4

How Build a Robo-Advisor with Python (From Scratch) covers it

How deep it goes
Defines order-book mechanics and implements half-spread buy and sell assumptions, while deferring average-spread estimation details.
Examples
Uses a QQQ quote and compares SPY, IVV, VOO, and SPLG ownership costs.
What it assumes
Introduces bids, asks, order compatibility, and mid price from zero before using ETF cost calculations.
What you can do after
Apply it via a Python backtester by converting fractional spreads into assumed buy and sell prices.
How it connects
Connects bid–ask spreads with ETFs, mid price, expense ratios, rebalancing, and tax-loss harvesting.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Robo-Advisor with Python (From Scratch). The section links point to the parts of the book it draws on.