Sub topic 13
Costs, fees and settlement
This chapter covers what a trade costs beyond the share price, and when the trade becomes final. It assumes you can read a quote (bid, ask, spread), know the difference between a market order and a limit order, and understand order statuses such as "filled". This is educational material, not investment advice.
The cost of a trade has several parts
The price on the order ticket is only one piece of what you pay or receive. Costs fall into two groups: explicit costs that appear as line items on your statement, and implicit costs that are built into the price you get.
| Cost | Type | Who charges it | When it applies |
|---|---|---|---|
| Commission | Explicit | Broker | Per trade or per share, if the broker charges one. Many retail brokers charge zero for US stocks. |
| Regulatory fees | Explicit | Exchanges and regulators, passed on by the broker | Mostly on sells, and very small |
| Other broker fees | Explicit | Broker | Account, wire, paper statement or foreign-exchange fees, depending on the broker |
| Bid-ask spread | Implicit | Market makers and other traders | Every round trip (a buy followed by a sell) |
| Slippage | Implicit | The market | Mostly on market orders, and on thin or fast-moving stocks |
| Payment for order flow and price improvement | Implicit | Broker and market maker | When your broker routes your order to a wholesale market maker |
Fee schedules differ by broker and country, and they change. Read your broker's current schedule before relying on any figure here.
Commissions and "zero-commission" trading
A commission is a fee the broker charges for executing your order. It may be a flat amount per trade, a rate per share, or a percentage of the trade value. Many brokers now charge no commission on stock trades, but they still earn money in other ways: interest on cash balances, lending out shares, fees for other services, and payment from market makers that receive your orders.
"Zero commission" therefore does not mean "zero cost". The spread and slippage are still there. They show up inside your execution price instead of on a separate line.
Regulatory fees
In the US, two small fees are commonly passed through on sales: the SEC fee and the FINRA Trading Activity Fee. Rates are set by the regulators and revised from time to time. They are tiny for small trades, often a few cents or less. Other countries have their own equivalents, such as stamp duty on purchases in the UK, which is a percentage of the purchase value and not small. Check the rules for the market you trade in.
The spread as a cost
The spread is a cost you pay when you buy at the ask and later sell at the bid. Using the quote from the earlier chapter, the bid is 49.98 and the ask is 50.02.
def spread_info(bid, ask):
spread = round(ask - bid, 4)
mid = (bid + ask) / 2
return spread, round(spread / mid * 100, 3)
bid, ask = 49.98, 50.02
spread, spread_pct = spread_info(bid, ask)
print(spread, spread_pct) # 0.04 0.08
qty = 20
print(round(qty * ask, 2)) # 1000.4 estimated cost of a market buy at the askThe spread is 0.04 per share, about 0.08% of the midpoint. If you buy 20 shares at the ask and sell them immediately at the bid, you lose 20 × 0.04 = 0.80 before any fees. That loss is the round-trip cost of the spread.
For heavily traded stocks the spread may be one cent. For small or rarely traded stocks it can be several percent, which is often a larger cost than any commission.
Slippage and order type
Slippage is the difference between the price you expected and the price you got. A market order accepts whatever the order book offers, so it can walk up the asks. A limit order sets a ceiling (for a buy) or a floor (for a sell), so it cannot slip past your price, but it may not fill completely.
def fill_buy(asks, qty, limit=None):
"""Simulate a buy against a list of (price, size) asks.
limit=None behaves like a market order; otherwise like a limit order."""
filled, cost = 0, 0.0
for price, size in sorted(asks):
if limit is not None and price > limit:
break
take = min(size, qty - filled)
filled += take
cost += take * price
if filled == qty:
break
avg_price = cost / filled if filled else None
return filled, avg_price
asks = [(50.02, 100), (50.05, 200), (50.10, 500)]
print(fill_buy(asks, 400)) # market order
print(fill_buy(asks, 400, limit=50.05)) # limit orderThe market order fills all 400 shares at an average of about 50.055. Measured against the best ask of 50.02, that is about 0.035 per share of slippage, or 400 × 0.035 = 14.00 in total. The limit order at 50.05 fills only 300 shares at an average of 50.04 and leaves 100 unfilled. Slippage is zero relative to your limit, and you accepted a partial fill in exchange.
Price improvement and order routing
Most retail orders do not go straight to a public exchange. Brokers often send them to wholesale market makers, who may fill them at the quoted price or slightly better. A fill better than the best quote is called price improvement. In return, the market maker may pay the broker a fee, called payment for order flow.
The effect on you depends on execution quality. Brokers publish routing and execution statistics. If you trade often or in size, compare them. For a first trade of a few hundred dollars in a liquid stock, the difference is usually pennies.
Estimating the cost of an order before you send it
The order ticket gives an estimate, not a guarantee. The ticket from the earlier chapter shows the idea.
Side: BUY
Symbol: XYZ
Quantity: 20
Order type: LIMIT
Limit price: 50.00
Time in force: DAY
Estimated cost: 20 x 50.00 = 1000.00 at most, plus any feesWith a limit buy, the shares times the limit price is a hard ceiling on the share cost. With a market buy, the broker usually estimates from the last price or the ask, and the real cost can be higher. A reasonable worst-case estimate for a market buy is:
- Take the quantity.
- Multiply by the current ask.
- Add a margin for slippage, such as a few spreads per share on a thin stock.
- Add commissions and fees.
Also confirm that your buying power covers the worst case. Some brokers reserve extra cash for market buys because the fill price is unknown.
Settlement: when the trade becomes final
A trade is executed when the order is matched. It is settled when the shares are actually delivered to the buyer and the cash to the seller. These are different moments.
In the US and Canada, most stocks settle one business day after the trade date. This is called T+1 ("trade date plus one business day"). It took effect in May 2024 in the US, replacing T+2. Other markets use T+1, T+2 or other cycles. Weekends and market holidays do not count as business days.
from datetime import date, timedelta
def settlement_date(trade_date, days=1, holidays=()):
"""Return the settlement date, skipping weekends and listed holidays."""
current = trade_date
remaining = days
while remaining > 0:
current += timedelta(days=1)
if current.weekday() < 5 and current not in holidays:
remaining -= 1
return current
# A Friday trade settles on Monday under T+1.
print(settlement_date(date(2026, 11, 27))) # 2026-11-30
# Thanksgiving (Thursday, 2026-11-26) is a market holiday.
print(settlement_date(date(2026, 11, 25), holidays={date(2026, 11, 26)})) # 2026-11-27What settlement means for you
- You can usually see and sell your shares right after the fill. The broker shows them in your account on the trade date.
- Cash from a sale may appear as "unsettled" until the settlement date. Many brokers let you use it to buy again immediately, but some limit what you can do with it.
- In a cash account, buying with unsettled sale proceeds and then selling that new purchase before the original sale settles can trigger a good-faith violation. Repeated violations can restrict your account for a period. A margin account avoids this, but it brings its own rules and risks.
- Withdrawing cash to your bank generally requires the funds to be settled.
Ownership dates and dividends
Settlement timing also affects who receives a dividend. The ex-dividend date is the first day a buyer no longer gets the upcoming dividend. Since the move to T+1, it is normally the same day as the record date. You must buy before the ex-dividend date to receive the payment. Selling on or after that date still lets you keep it.
Taxes
Selling at a profit can create a tax liability, and the rules depend on your country and how long you held the shares. Your broker may provide a cost-basis report. This tutorial does not cover tax rules. Keep your trade confirmations and statements.
Common errors
- Comparing brokers on commission alone and ignoring spread, routing and fees on other services.
- Forgetting that a round trip costs the full spread, so a stock must rise by more than the spread plus fees for you to break even.
- Treating the ticket's estimated cost as exact on a market order.
- Assuming sale proceeds are available to withdraw on the same day.
- Reusing unsettled cash in a cash account without checking the broker's rules.
- Ignoring currency conversion fees when buying a stock listed in another currency.
Break-even on a round trip
A useful number is how far the price must move for you to recover your costs. Using the example quote, you buy at the ask 50.02 and could sell at the bid 49.98. You are down 0.04 per share at the moment of purchase. If you also pay a fee of 0.01 per share on the sale, the bid must rise to 50.03 before you break even.
def breakeven_bid(buy_price, per_share_fees):
"""Bid price needed to recover the purchase price plus per-share fees."""
return round(buy_price + per_share_fees, 4)
print(breakeven_bid(50.02, 0.01)) # 50.03Exercise
You buy 100 shares with a market order. The best ask was 20.00, and the order fills at an average of 20.03. The bid at the time was 19.97. Your broker charges no commission, and you pay no other fee. (a) What was the slippage in total dollars? (b) If you sold all 100 shares immediately at the bid of 19.97, what would the round trip cost you in total? (c) You sell on a Friday. When does the trade settle under T+1, assuming no holidays?
Show answer
(a) Slippage is (20.03 - 20.00) × 100 = 3.00. (b) You paid 20.03 × 100 = 2003.00 and received 19.97 × 100 = 1997.00, so the round trip cost 6.00. That includes the 3.00 of slippage and the 3.00 from the quoted spread's half below the ask side. (c) The trade settles on the following Monday, because Saturday and Sunday are not business days.
Exercise
A stock has a bid of 10.00 and an ask of 10.10. Express the spread as a percentage of the midpoint, rounded to two decimals. Then explain why a "zero-commission" broker does not make trading this stock free.
Show answer
The midpoint is 10.05 and the spread is 0.10, so the spread is 0.10 / 10.05 × 100 ≈ 1.00%. A buyer who sells right away at the bid loses about 1% of the value even with no commission, because the spread, slippage and other fees are still paid inside the price.