Skip to content
Finance Lessons

Algorithmic Trading & Execution

The Cost of Trading

Explicit vs implicit trading costs — commissions, fees, spread, market impact, timing and opportunity cost — and the trader's dilemma of speed versus stealth that algorithms exist to solve.

11 min Updated Jun 13, 2026

A backtest is a beautiful lie. On paper, your strategy buys at exactly the price it decided to buy at, in any size, instantly, for free. In the real market, every one of those assumptions costs you money — and the bigger your order, the more brutal the bill. Before we can measure execution quality, we have to enumerate what we’re actually paying. This lesson is the taxonomy of trading costs: the obvious ones on your statement, the much larger ones that never appear on any invoice, and the central trade-off that makes execution an optimization problem rather than a button you press.

Before you read — take a guess

A pension fund buys 600,000 shares of a stock that trades 2 million shares a day. Which cost is most likely to dominate its total bill?

Explicit vs implicit costs

Analogy. Trading costs are an iceberg. The part above the waterline — commissions, fees, taxes — is what you can see, count, and put on an invoice. It looks like the whole thing. But 90% of the mass is below the surface: the price you moved, the price that drifted while you waited, the shares you never got. Retail traders capsize on the tip; institutions are sunk by the part nobody itemizes.

Definition. Explicit costs are contractually fixed, observable amounts paid to a named counterparty: commissions (to your broker), exchange and regulatory fees (e.g. SEC/FINRA fees in the US), taxes such as the UK’s 0.5% stamp duty on share purchases, and the half-spread you pay by crossing the bid-ask spread to trade immediately. Implicit costs are not billed — they’re the difference between the price you wanted and the price you got, driven by market impact (your own order moving the price), timing/delay cost (the price drifting between your decision and your fills), and opportunity cost (the part of the order that never fills, so you miss the move entirely).

CostTypePaid to / lost how
CommissionExplicitYour broker, per share or per trade
Exchange + regulatory feesExplicitThe exchange / regulator
Stamp duty / transaction taxExplicitThe government (e.g. UK 0.5%)
Bid-ask spread (half-spread crossed)ExplicitThe market maker / liquidity provider
Market impactImplicitThe market — your demand moves price against you
Timing / delay costImplicitNobody — price drift while you work the order
Opportunity costImplicitNobody — the alpha on shares you never filled

Worked example. You buy 100,000 shares with a mid price of $50.00. Commission is $0.005/share = $500. The quoted spread is $0.04, so crossing it costs a half-spread of $0.02/share = $2,000. But working the order pushes the average fill to $50.18 — that’s $0.18/share of market impact = $18,000. Total cost: $500 + $2,000 + $18,000 = $20,500 on a $5,000,000 notional, or 41 bps. The commission everyone obsesses over is 1 bp; the impact nobody invoiced you for is 36 bps.

Warning:

The headline-fee illusion

A broker advertising “zero commission” has eliminated 1 of your 41 basis points. The other 40 are still there, just unlabeled. For any meaningful size, optimizing the visible fee while ignoring impact is rearranging deck chairs on the iceberg.

Pitfall. Equating “cost” with “the number on the statement.” Explicit costs are easy to measure precisely, which is exactly why they get over-managed — the streetlight effect. The expensive costs are invisible because they’re hard to attribute.

When it matters. For a 200-share retail order, the spread and a fixed commission are essentially the whole cost; impact is zero. For a 600,000-share institutional order, commission is a rounding error and impact is the ballgame. Cost structure flips with size.

Fill in the cost taxonomy.

Pick the right option for each blank, then check.

A commission paid to your broker is an cost, whereas the price you move against yourself by demanding liquidity is , which is an cost that scales with order .

The trader’s dilemma — the urgency trade-off

Analogy. Imagine emptying a swimming pool with a bucket. Bail fast and you splash water everywhere — you waste effort fighting the chaos you create (that’s impact). Bail slowly with tidy little scoops and you’re elegant, but the sun is evaporating the pool out from under you and a storm might refill it (that’s timing risk and opportunity cost). There’s no way to empty it for free; the smart move is somewhere between frantic and glacial.

Definition. Every execution faces a trade-off governed by urgency. Trade fast and you demand liquidity now — you cross spreads and move the price, so market impact is high. Trade slow and you supply liquidity patiently, minimizing impact, but you expose yourself to timing risk: the price can drift away from you over the hours you’re working (and the variance of that drift grows with the square root of time), plus opportunity cost if the order doesn’t finish. Roughly, impact behaves like IσQ/VI \propto \sigma\sqrt{Q/V} — rising with order size QQ relative to volume VV — while timing risk grows like σT\sigma\sqrt{T} with the time TT you stretch the trade. One falls as the other rises, so total expected cost is U-shaped and the optimum sits in the middle.

Implementation shortfall: where the cost goes
Total shortfall26 bps
1Delay3Spread & fees20Market impact2Timing (drift)Opportunity26TotalCost (bps)

Trading fast crushes timing risk and leaves nothing unfilled — but you pay for it in market impact, which dominates the bill. You move the price against yourself by demanding liquidity now.

Toggle 'Trade fast' vs 'Trade slow' and watch the cost composition flip — fast is market-impact-heavy; slow trades that impact away for timing and opportunity cost.

Worked example. Same 500,000-share buy, two execution styles, decision price $100.00:

Trade fast (15 min)Trade slow (full day)
Market impact35 bps8 bps
Timing / delay cost5 bps22 bps
Opportunity cost (unfilled)0 bps9 bps
Total expected cost40 bps39 bps

Crank urgency to the max and impact explodes; drag it out and impact melts but timing and opportunity cost swell to fill the void. Here the two extremes land near 40 bps while a balanced schedule — say, a 2-hour participation — might come in around 28 bps. The lesson isn’t “slow is better”; it’s that both extremes are dominated by a middle, and which middle depends on your volatility, urgency, and conviction.

Tip:

Urgency is a knob, not a setting

A trader with strong short-term alpha should accept more impact to capture the move before it decays. A patient index rebalancer with no time pressure should minimize impact and tolerate timing risk. The “right” point on the curve is a function of why you’re trading, not a universal constant.

Pitfall. Believing “be patient” is always cheaper. Patience converts a known, paid cost (impact) into a random, unpaid-but-real cost (price drift). On a day the stock runs away from you, slow execution is the catastrophe — and you can’t invoice the regret.

When it matters. The dilemma bites hardest when order size is large relative to daily volume and volatility is high. A tiny order in a calm, liquid name barely feels it; a big order in a volatile small-cap lives and dies on this trade-off.

An execution trader slows a large buy order from 15 minutes to a full trading day. Holding the order unchanged, what happens to the cost mix?

Parent orders, child orders, and why algorithms exist

Analogy. You can’t drink a lake through a fire hose without flooding the kitchen. If a fund decides to buy 500,000 shares of a stock that trades 2 million a day, slamming a single market order would be like dumping the whole lake at once — the price gaps up and everyone front-runs the splash. Instead you sip: thousands of small cups spread across the day, each one barely disturbing the surface.

Definition. The big decision — “buy 500,000 shares” — is the parent order. The fund never sends it to the market directly. An execution algorithm slices the parent into many small child orders and works them over time, deciding moment to moment whether to post passively (earn the spread, risk not filling) or take liquidity (pay the spread, fill now). A key dial is the participation rate: the fraction of market volume the algorithm aims to be, e.g. “be 10% of volume” means for every 100 shares the market trades, the algo trades about 10. Low participation hides in the flow and minimizes impact but stretches the order (more timing risk); high participation finishes fast but leaves footprints.

Worked example. A 500,000-share parent in a name doing 2M shares/day, targeting 10% participation, completes in roughly half a day and trades in child clips of perhaps 200–800 shares to stay in the noise. Bump the target to 25% participation and you finish in about 2 hours — faster, but now you’re a quarter of all activity, far more visible, and impact climbs. The participation rate is the urgency knob from the previous section, made operational.

Match each execution term to what it actually refers to.

Pick a term, then click its definition.

Why not just post one big passive limit order at the bid and wait for fills — surely that’s zero impact?

It feels free, but it isn’t. First, a large resting order is information: smart counterparties see the iceberg’s tip, infer a big buyer, and pull their offers or step ahead of you — your “patient” order leaks intent and ironically creates impact. Second, while you sit there, the price can climb past your limit and never come back: you’ve traded impact for opportunity cost, and on a trending day you simply don’t fill. Third, even resting orders get adversely selected — you tend to fill exactly when the market is moving against you (you buy right before it ticks down). The art of an execution algorithm is balancing passive posting (cheap when it works) against active taking (certain but costly), child order by child order, so that neither impact nor timing risk runs away. A single static limit order optimizes for one of these and ignores the rest.

Paper return vs implementation

Analogy. It’s the difference between the recipe and the dinner. The backtest is the recipe: clean, idealized, “fold in 500,000 shares at $100.” The implementation is the actual cooking in a hot, crowded kitchen where ingredients cost more than listed, some burn, and you run out of others. The gap between the recipe’s promise and what lands on the plate is the entire subject of this course.

Definition. The paper return (or backtested return) is what a strategy earns assuming costless, instantaneous fills at the decision price — the price when the signal fired. The implemented return subtracts everything above: spread, commission, fees, taxes, market impact, timing drift, and the opportunity cost of unfilled shares. The difference between them — the all-in cost of converting a decision into a position — is implementation shortfall, the scorecard we’ll spend the rest of the course measuring and minimizing.

Worked example. A signal fires at a decision price of $100.00 and the model projects a 5% gross alpha — $5.00/share of paper profit. Execution lands an average buy at $100.32 (32 bps all-in cost), and 6% of the intended shares never fill, missing the move. Net of costs, the realized edge shrinks from 5.00% to roughly 4.68% on the filled portion, with the unfilled slice contributing pure opportunity cost. A third of a percent sounds trivial — until you remember it recurs on every trade, every rebalance, forever. For a high-turnover strategy, implementation shortfall can quietly eat more than the alpha it was chasing.

Info:

The strategy you can't trade isn't a strategy

A backtest showing 12% a year that costs 14% a year to implement is a 2% loser dressed as a winner. Costs aren’t a footnote to the strategy — they’re a constraint baked into whether the strategy exists at all.

Pitfall. Treating costs as a flat haircut applied after the fact (“subtract 10 bps and move on”). Costs are endogenous — they depend on how you trade, how fast, in what size, in what name. The same alpha implemented two different ways can be a winner or a loser. That’s precisely why execution is an active discipline and not an accounting adjustment.

When it matters. Always, but lethally for high-turnover and capacity-constrained strategies. A buy-and-hold investor pays the cost once; a strategy rebalancing daily pays it every day, and the bigger the assets under management, the larger each order relative to volume, and the steeper the impact. Costs are how good strategies hit a capacity ceiling.

Putting it together

Trading is never free, and the part that’s free to see — commissions and fees — is almost never the part that’s expensive. The real bill is implicit: the price you move by demanding liquidity (impact), the price that drifts while you wait (timing risk), and the alpha on shares you never got (opportunity cost). These costs trade off against each other along the axis of urgency, which is why a fund splits a big parent order into many child orders worked by an execution algorithm at a chosen participation rate — there’s no single fastest or cheapest way, only an optimum in the middle that depends on volatility, conviction, and size. The distance between the clean backtested paper return and the messy implemented return is implementation shortfall, and shrinking it is the job this course is about.

Big picture

The cost of trading at a glance

  • Cost of trading
    • Explicit (visible)
      • Commission
      • Exchange + reg fees
      • Stamp duty / tax
      • Spread crossed
    • Implicit (hidden, larger)
      • Market impact
      • Timing / delay
      • Opportunity cost
    • Trader's dilemma
      • Fast → impact
      • Slow → timing + opp cost
      • Optimum in the middle
    • Algorithms
      • Parent order
      • Child orders
      • Participation rate
    • Scorecard
      • Paper return
      • Implemented return
      • Implementation shortfall
Explicit costs are visible and small; implicit costs are hidden and large; the dilemma and algorithms exist to manage them.

Cost-of-trading check

Question 1 of 40 correct

Why do implicit costs dwarf explicit costs for institutional-size orders, but not for tiny retail orders?

Check your answer to continue.

We’ve named the costs and seen why they fight each other. The natural next question is: how do we put a single, honest number on the gap between the trade we decided to make and the trade we actually got? That number has a name — implementation shortfall — and in the next lesson we build it from the ground up, decompose it into the exact buckets we sketched here, and turn it into the scorecard every execution desk lives and dies by.

Mark lesson as complete