AnyLearn
All lessons
Businessadvanced

Costs, Capacity, and a Protocol You Can Trust

The edge that survives statistics still has to survive trading. Spread, market impact and the square-root law, why every strategy has a capital ceiling, and the research protocol that makes a backtest worth believing.

Updated · AI-authored, review-gated · how lessons are made

Not signed in: your progress and quiz score won't be saved.
Progress1 / 9

The third filter

Two filters have been passed. The simulation is mechanically honest, and the result is unlikely to be pure selection.

A third remains, and it kills more strategies than either: you have to actually trade it.

The gap here is not statistical. It is that a backtest computes returns from prices in a data file, and a data file is not a counterparty. Between the price you see and the money you keep sit several costs, and in the strategies that look most attractive they are largest.

That correlation is the trap. High-turnover strategies show the smoothest equity curves and the highest Sharpe ratios, because trading often diversifies across many small bets. They are also the strategies that pay costs most often.

So the ranking of strategies before costs and after costs can be close to reversed. A backtest that ignores costs does not merely overstate returns by a constant, it points you at the wrong strategy.

This lesson covers what those costs are, why they grow with your size, and how to run a research process whose outputs mean something.

Full lesson text

All 9 steps on one page, for reading, reference, and search.

Show

1. The third filter

Two filters have been passed. The simulation is mechanically honest, and the result is unlikely to be pure selection.

A third remains, and it kills more strategies than either: you have to actually trade it.

The gap here is not statistical. It is that a backtest computes returns from prices in a data file, and a data file is not a counterparty. Between the price you see and the money you keep sit several costs, and in the strategies that look most attractive they are largest.

That correlation is the trap. High-turnover strategies show the smoothest equity curves and the highest Sharpe ratios, because trading often diversifies across many small bets. They are also the strategies that pay costs most often.

So the ranking of strategies before costs and after costs can be close to reversed. A backtest that ignores costs does not merely overstate returns by a constant, it points you at the wrong strategy.

This lesson covers what those costs are, why they grow with your size, and how to run a research process whose outputs mean something.

2. What a trade actually costs

Four components, and they differ in how predictable they are.

Commissions and fees. Explicit, known in advance, and the easiest to model. Also usually the smallest.

The bid-ask spread. There is no single price. There is a price at which you can buy and a lower one at which you can sell. Cross that spread and you have paid roughly half of it immediately. A backtest using the midpoint, or worse the closing price, silently omits this on every trade.

Market impact. Your own order moves the price against you. Buying pushes the price up as you consume available offers, so the average price you pay is worse than the price you saw.

Slippage and opportunity cost. The delay between deciding and executing, plus the trades you wanted and could not get. This one is asymmetric in a way that hurts: the orders that fail to fill are disproportionately the ones where the price ran away from you, meaning your winners are the trades you miss.

The first two are straightforward to include. The third is where the real difficulty lives, because it is the only one that depends on how much you trade.

3. The square-root law

Market impact has a regularity that is unusually robust across markets, venues, and decades, and it is the single most useful quantitative fact in this lesson.

Impact scales approximately with the square root of the order size relative to typical daily volume:

impact  ~  c * volatility * sqrt(Q / V)

  Q = size you want to trade
  V = average daily volume
  c = a constant of order 1, estimated per market

The square root is the important part, and it cuts both ways.

It is better than linear. Doubling your size does not double your impact per share; it raises it by about 41 percent. Large traders are not penalised proportionally.

It is worse than constant. Impact per share grows with size. Your average execution price gets worse the more you trade, so cost per unit of capital is not fixed.

That second point is what a backtest almost always misses. Backtests typically apply a fixed cost per trade, in basis points, independent of size. That model is correct only for a trader small enough not to matter, and it is precisely wrong in the direction that flatters you as you scale.

With a square-root model, the cost of running a strategy grows faster than the capital deployed.

4. Capacity

The square-root law implies something that surprises people new to the field: every strategy has a maximum size beyond which it stops working.

The argument is short. Gross return per unit of capital is roughly constant in your size, since the edge is a property of the signal. Cost per unit of capital grows with size, by the square-root law. So net return declines as you scale, crosses zero at some point, and goes negative after.

That crossing point is the strategy's capacity, and it is a hard economic ceiling rather than an operational inconvenience.

Capacity varies enormously. A statistical arbitrage strategy trading small-cap equities intraday might saturate at a few tens of millions. A slow, low-turnover value strategy in large-cap equities might absorb billions.

Two practical consequences follow.

Capacity is inversely related to attractiveness. The highest-Sharpe strategies are usually high-turnover and low-capacity. This is not a coincidence, it is competitive: a high-return strategy with large capacity would attract capital until the edge was traded away.

A backtest at unrealistic size is meaningless. Simulating 100 million dollars in a market where your orders would be a large fraction of daily volume produces a curve that could never have been earned by anyone.

5. Why net return has a ceiling

Two curves with different shapes decide the outcome. Gross return per unit of capital is roughly flat in size; cost per unit rises with the square root of participation. Their difference peaks and then falls through zero, and where it crosses is the capacity.

flowchart TD
  A["Deploy more capital in the strategy"] --> B["Gross edge per unit stays roughly constant"]
  A --> C["Participation in daily volume rises"]
  C --> D["Impact per share grows as sqrt of size"]
  D --> E["Cost per unit of capital rises"]
  B --> F["Net return = gross minus cost"]
  E --> F
  F --> G["Net peaks, then declines"]
  G --> H["Crosses zero at the capacity limit"]

6. Modelling costs honestly

A cost model that scales with size turns a backtest from a story into an estimate.

def trade_cost(qty, price, adv, volatility, spread, c=0.5):
    """Cost in currency for trading `qty` shares."""
    notional = abs(qty) * price

    # cross the spread: pay about half of it
    spread_cost = 0.5 * spread * abs(qty)

    # market impact: square-root in participation rate
    participation = abs(qty) / adv
    impact = c * volatility * (participation ** 0.5) * notional

    return spread_cost + impact + commission(notional)

Three habits make this useful rather than decorative.

Sweep the cost assumption. Run the backtest at your estimate, at double it, and at quadruple it. A strategy whose profitability survives only the optimistic figure is not a strategy, it is a cost forecast.

Report the break-even. Compute the cost level at which the edge disappears, then compare it to what you actually pay. A strategy breaking even at 2 basis points when you pay 5 is dead, and saying so is more useful than any Sharpe.

Model costs before ranking. Because costs reorder strategies, applying them at the end means you already selected the wrong candidate.

7. Walk-forward, and spending your data

The first lesson established that a holdout is consumable. Walk-forward analysis is the standard way to get more out of a fixed history without pretending otherwise.

Rather than one split, you roll. Fit on a window, test on the period immediately after, then advance both and repeat. Every test period is strictly out-of-sample relative to the data used to fit it, and you accumulate many such periods.

fit [-------]  test [--]
     fit [-------]  test [--]
          fit [-------]  test [--]

This has two genuine advantages. It matches how the strategy would actually be run, with parameters periodically refit. And it exposes the strategy to multiple regimes rather than one arbitrary holdout.

It is not a solution to overfitting, and this is where people over-trust it. If you run walk-forward, dislike the aggregate, change the strategy, and run it again, you are selecting on the walk-forward result. The procedure is now in-sample.

The honest framing is that walk-forward makes the evaluation more realistic. It does nothing about selection, which is why the deflated Sharpe ratio from the previous lesson is complementary rather than redundant.

8. A protocol that produces trustworthy results

Assembling everything into a workflow. The ordering matters, because each step is cheap relative to the one after it.

1. State the mechanism first.
   Who is on the other side, and why do they trade against you?
   A strategy with no answer is a pattern, not an edge.

2. Pre-register the test.
   Write down the rules, parameters, universe and metric
   BEFORE running the backtest.

3. Verify the simulation mechanically.
   Point-in-time data, fills after signals, random-signal test.

4. Log every trial, including failures.
   The count is the input to every correction that follows.

5. Apply costs that scale with size, then rank.

6. Deflate for the number of trials.

7. Confirm on data you have never touched. Once.

8. Size to capacity, then trade small and compare to the backtest.

Step 1 does more work than the rest combined. A mechanism is a hypothesis formed before the data, which is exactly what every statistical correction is trying to reconstruct after the fact. Strategies with an economic story behind them survive contact with live markets at a noticeably better rate than strategies found by search.

Step 8 is the only real test. Everything before it is an argument about a counterfactual; live trading is an observation.

9. What this path establishes

Four claims, and the habit worth keeping.

A backtest is a counterfactual, not a measurement. It asserts what would have happened had you traded, which is an interventional claim requiring assumptions the historical record cannot supply. Markets compound this, because had you traded, the history itself would have differed.

Mechanical biases make it wrong before statistics begin. Look-ahead, survivorship, and non-point-in-time data all bias the same direction, so small defects compound into spectacular curves rather than mildly optimistic ones.

Selection inflates the winner even when nothing works. The maximum of many draws sits well above zero, so the deflated Sharpe ratio and the probability of backtest overfitting correct for trials, sample length, skew and kurtosis. Published finance faces the same problem at professional scale, which is why Harvey, Liu and Zhu argue for a t-statistic above 3.0.

Costs scale with size and impose a capacity ceiling. Impact grows with the square root of participation, so net return peaks and then falls through zero. The most attractive strategies are usually the lowest-capacity ones.

The habit: when you see an equity curve, ask how many were tried, what was assumed about costs, and who is on the other side. Those three questions dispose of most of what looks profitable.

Check your understanding

The lesson ends with a 5-question quiz. Take it in the player above to see your score.

  1. Why can ignoring transaction costs change which strategy you select, not just the returns?
    • Costs are subtracted after the Sharpe ratio is annualised
    • High-turnover strategies show the best pre-cost Sharpe ratios and also pay costs most often, so the ranking can reverse
    • Commission schedules vary unpredictably between brokers
    • Costs are proportional to holding period rather than trade count
  2. What does the square-root law say about market impact?
    • Impact is constant per share regardless of order size
    • Impact doubles when order size doubles
    • Impact scales with the square root of order size relative to average daily volume
    • Impact falls as participation rises due to liquidity provision
  3. Why does every strategy have a capacity limit?
    • Regulators cap position sizes in most liquid markets
    • Volatility rises with position size, reducing the Sharpe ratio
    • Available historical data limits how much can be validated
    • Gross edge per unit of capital is roughly flat while cost per unit grows with size, so net return eventually crosses zero
  4. What does walk-forward analysis fix, and what does it leave untouched?
    • It makes evaluation more realistic across regimes, but does nothing about selection bias
    • It eliminates overfitting entirely by using rolling windows
    • It removes look-ahead bias but not survivorship bias
    • It corrects for transaction costs but not market impact
  5. Why does stating the economic mechanism first do more work than the statistical corrections?
    • Mechanisms can be tested without any historical data
    • It is a hypothesis formed before the data, which is what every after-the-fact correction is trying to reconstruct
    • Regulators require a documented rationale for systematic strategies
    • It allows the strategy to be patented before deployment

Related lessons

AI
advanced

The Look-Ahead Problem: Your Model Already Knows

Backtesting a language model signal has a defect no other signal has. The model was trained on text from the period being tested, so it may already know what happened next, and it uses that knowledge even when instructed not to. This lesson establishes the problem from the published evidence, shows why prompting does not fix it, and covers what does.

8 steps·~12 min
AI
advanced

Reading the Evidence Carefully

The most prominent study in this area found a language model predicting stock reactions from headlines, and it is usually reported as proving something it explicitly does not claim. This lesson reads it precisely, follows its qualifiers to their consequences, and shows why a real statistical result and a tradable strategy are different things.

8 steps·~12 min
AI
advanced

Where LLMs Actually Fit in a Trading Firm

The popular framing is a model that predicts prices. That is the one job the technology is worst suited to, and it obscures the one it is genuinely good at: turning unstructured text into structured data at a scale that was previously unaffordable. This lesson locates LLMs against the trading stack and rules out the places they cannot go.

8 steps·~12 min
Business
advanced

Measuring Execution Honestly

Execution costs are small numbers buried in large noise, so distinguishing a good desk from a lucky one takes more data than most institutions have. This lesson covers what transaction cost analysis can establish, the reversion test that detects information leakage, and what happens to any measure once people are paid on it.

8 steps·~12 min