Sub topic 11
What a Trade Really Costs
This chapter assumes you know what a bid and an ask price are, how market and limit orders differ, and how routing and matching work from the earlier chapters. It breaks the cost of a trade into explicit fees you can see on a statement and implicit costs you can only infer from prices. For most retail investors in US stocks, the implicit costs are larger than the visible ones.
Explicit and implicit costs
Explicit costs are charges listed on your confirmation or fee schedule. Implicit costs are losses against a reference price that no one bills you for.
| Cost | Type | Who receives it | Typical size for a US retail stock trade |
|---|---|---|---|
| Commission | Explicit | Broker | Often $0 for online stock trades |
| Regulatory fees | Explicit | SEC and FINRA, passed through by the broker | Cents per trade, on sales only |
| Exchange or venue access fees | Explicit, usually absorbed or bundled | Exchange | Fractions of a cent per share |
| Bid-ask spread | Implicit | Whoever provides liquidity | One cent or more per share |
| Price impact | Implicit | Counterparties who move their quotes | Grows with order size |
| Currency conversion | Explicit or implicit | Broker or bank | Often a markup on the exchange rate |
| Timing and delay | Implicit | Nobody in particular | Varies with volatility |
A "zero-commission" broker does not mean a free trade. The broker earns money in other ways, such as payment for order flow, interest on cash balances, securities lending, and fees for premium services. Those sources are why you should still measure what you pay.
The bid-ask spread
The bid is the highest price a buyer is currently willing to pay. The ask is the lowest price a seller is currently willing to accept. The difference is the spread.
Suppose a stock quotes 10.00 bid and 10.02 ask. The spread is 0.02, and the midpoint is 10.01. If you buy at market, you pay about 10.02. If you sold immediately afterward at market, you would receive about 10.00. That round trip costs 0.02 per share even though the "true" price never moved.
The spread pays for liquidity. A market maker who quotes both sides risks holding shares that fall in value, and the spread compensates that risk. Spreads tend to be:
- Narrow for heavily traded, large-company stocks, often the minimum tick of one cent.
- Wide for thinly traded stocks, small companies, and exchange-traded funds with sparse trading.
- Wider at the open, at the close, and around news, when uncertainty is high.
Measuring spread cost
Two measures are common. The quoted half-spread is the distance from the midpoint to the price you could trade at. The effective spread uses the price you actually got.
For a buy, effective half-spread = execution price − midpoint at the time of the order. Multiply by shares to get dollars. Venues that price improve by filling inside the quoted spread give you a lower effective spread than the quoted one.
def trade_cost(side, shares, exec_price, bid, ask, commission=0.0):
"""Return the effective half-spread cost per share and in total.
The midpoint at order arrival is the reference price.
For a buy, paying above the midpoint is a cost.
For a sell, receiving below the midpoint is a cost.
"""
mid = (bid + ask) / 2
if side == "buy":
per_share = exec_price - mid
else:
per_share = mid - exec_price
spread_cost = per_share * shares
return {
"midpoint": round(mid, 4),
"cost_per_share": round(per_share, 4),
"spread_cost": round(spread_cost, 2),
"total_cost": round(spread_cost + commission, 2),
}
# Quote is 10.00 x 10.02. A market buy fills at the ask.
print(trade_cost("buy", 500, 10.02, 10.00, 10.02))
# The same buy gets 0.005 of price improvement and fills at 10.015.
print(trade_cost("buy", 500, 10.015, 10.00, 10.02))
# A market sell fills at the bid.
print(trade_cost("sell", 500, 10.00, 10.00, 10.02))The first call shows 0.01 per share, or 5.00 on 500 shares. The second shows 0.005 per share, or 2.50. The third shows the same 0.01 per share on the sell side. The spread is paid once on each side of a round trip.
Price impact and depth
The quoted spread applies only to the quantity displayed at the best price. If your order is larger than that quantity, it consumes the next price level and the next. The extra cost is price impact, also called slippage.
The order book from the matching chapter shows the mechanism. A buy for 120 shares at a limit of 10.02 filled 50 at 10.01 and 70 at 10.02. If the book had held only 50 shares at 10.02 and the rest at 10.05, a market order for 120 would have walked up the book and paid more on the final shares. A market order has no price limit, so it accepts whatever the book offers.
def walk_book(asks, shares):
"""Fill a market buy against ask levels [(price, qty), ...] sorted low to high.
Returns the average price and the shares left unfilled."""
remaining = shares
spent = 0.0
for price, qty in asks:
take = min(remaining, qty)
spent += take * price
remaining -= take
if remaining == 0:
break
filled = shares - remaining
avg = spent / filled if filled else None
return avg, remaining
asks = [(10.02, 100), (10.03, 200), (10.10, 1000)]
for size in (50, 300, 800):
avg, left = walk_book(asks, size)
print(size, round(avg, 4), left)A 50-share order averages 10.02. A 300-share order averages about 10.0267. An 800-share order averages about 10.0838, because most of it fills at 10.10. For a small retail order in a liquid stock, depth rarely matters. For a larger order or a thin stock, it often dominates every other cost.
Limit orders trade cost for certainty
A limit order caps the price you pay, so it cannot suffer price impact beyond your limit. It has its own costs.
- Non-execution risk: if the market moves away, your order may never fill, and you miss the move you wanted to own.
- Adverse selection: a resting buy order tends to fill when the price is falling, and to stay unfilled when the price is rising. You get shares exactly when they were about to be cheaper, or you miss shares that were about to be dearer.
- Partial fills: you may get part of your order, leaving you with a position you did not plan for.
A marketable limit order, one priced at or through the opposite quote, behaves like a market order with a price ceiling. It is a common way to bound slippage while still expecting an immediate fill.
Payment for order flow and execution quality
Many retail brokers route orders to wholesale market makers, who pay the broker a small amount per share or per order. This is payment for order flow. It is legal in the US and disclosed in broker routing reports, but it creates a conflict of interest: the broker is paid by the party that is filling your order.
Whether you lose depends on execution quality, not on the payment itself. The relevant questions are:
- Price improvement: how often, and by how much, does the fill beat the quoted national best bid or offer?
- Speed: how fast does the fill arrive?
- Fill rate: how often do marketable orders fill completely?
Brokers must conduct regular reviews of execution quality under best-execution obligations. US rules also require market centers to publish execution statistics, and brokers to publish quarterly routing reports. You can read these to compare brokers. Other markets handle this differently. The European Union, for example, restricts payment for order flow, and Canada bans it for many order types, so check the rules where you trade.
Other costs worth knowing
Regulatory fees on sales
In the US, sales of stock carry small pass-through fees: a Section 31 fee to the SEC and a trading activity fee to FINRA. They are cents on typical retail sales and do not apply to buys. Your confirmation lists them if they apply.
Currency conversion
Buying a foreign stock from a US account usually involves converting dollars. A broker may apply a markup to the exchange rate instead of charging a visible fee. On a large purchase, a markup of 0.5 percent to 1 percent is a bigger cost than any spread. Compare the rate you received with the mid-market rate at that moment.
Taxes and stamp duties
Some markets tax transactions directly. The UK charges stamp duty of 0.5 percent on purchases of most UK-listed shares, and France and Italy have financial transaction taxes on certain stocks. The US has no equivalent tax on a stock purchase. Capital gains tax on profit is a separate matter and depends on your jurisdiction.
Fractional shares and odd lots
Fractional share orders are usually executed by the broker, either by combining orders or trading from its own inventory, rather than sent to an exchange. That convenience can come with a wider effective spread or restricted order types, so check how the broker prices them.
Putting the cost together
A rough way to account for a round trip in a liquid stock is:
total cost ≈ commissions + fees + (half-spread × 2) + price impact + currency markup
For a 500-share round trip in a stock quoted 10.00 by 10.02, with zero commission, the half-spread cost is about 0.01 × 500 × 2 = 10.00, plus any small sale fee. That is 0.1 percent of a roughly 5,000 position. For an investor who trades often, that repeated cost compounds into a real drag on returns.
Common errors
- Treating zero commission as zero cost, and ignoring the spread.
- Using a market order on a thin stock or at the open, when the spread is widest.
- Comparing the last traded price with your fill, when the midpoint at order time is the right reference.
- Setting a limit far from the market and then being surprised when it does not fill.
- Ignoring the currency markup on foreign purchases.
- Judging a broker only by commission and not by price improvement and fill quality.
Exercise
A stock quotes 20.00 bid and 20.04 ask. You send a market buy for 400 shares, and it fills at 20.03. Your broker charges no commission. What is your spread cost against the midpoint, per share and in total? How much price improvement did you get compared with the ask?
Show answer
The midpoint is (20.00 + 20.04) / 2 = 20.02. You paid 20.03, so the cost is 0.01 per share, or 0.01 × 400 = 4.00 in total. Price improvement against the ask is 20.04 − 20.03 = 0.01 per share, or 4.00 in total.
Exercise
The ask side of a book is 100 shares at 5.00, 100 shares at 5.02, and 500 shares at 5.10. What is the average price of a market buy for 250 shares, and why does a limit order at 5.02 behave differently?
Show answer
The order takes 100 at 5.00, 100 at 5.02, and 50 at 5.10. The cost is 500 + 502 + 255 = 1,257, so the average is 1,257 / 250 = 5.028. A buy limit at 5.02 would fill only the first 200 shares (average 5.01) and leave 50 unfilled, resting as a bid at 5.02. The limit avoids the 5.10 price but gives up certainty of a complete fill.