Skip to content
Finance Lessons

Algorithmic Trading & Execution

Execution-Aware Backtesting & HFT

Why transaction-cost-naive backtests lie, how capacity and alpha decay kill crowded edges, and a tour of the high-frequency strategies — market making, latency and statistical arbitrage — on the other side of your order.

13 min Updated Jun 13, 2026

Somewhere out there is a strategy with a glorious backtest: a 3.0 Sharpe, a smooth equity curve, drawdowns you could sleep through. It trades 40 times a day. It fills every order at the mid, in any size, instantly, for free. It is also, almost certainly, a fiction — because the moment you route those orders into a real market, the high-frequency machines on the other side, the spread you have to cross, and the price you push against yourself collect their toll on every single trade. This lesson is about closing the gap between the backtest and the broker statement: pricing execution into your simulation, knowing how much capital your alpha can actually hold, and understanding who you’re really trading against when your child orders hit the book.

Before you read — take a guess

A backtest shows a high-turnover strategy earning a strong, smooth profit. What single assumption most often turns that profit into a loss in live trading?

The transaction-cost-naive backtest

Analogy. Imagine timing a road trip assuming every traffic light is green, you never stop for gas, and the speed limit is infinite. Your estimate will be beautiful and useless. A transaction-cost-naive backtest is exactly that drive: it fills you at the mid, in unlimited size, with zero impact, every time. The real road has tolls (spread), traffic you create (impact), and lights that turn red as you arrive (slippage).

Definition. A transaction-cost-naive backtest is a simulation that assumes perfect, costless, infinitely-liquid execution — typically filling at the mid-price or the close with no spread paid, no market impact, and no slippage. Real execution costs are the sum of three things: the half-spread you cross, the market impact your own order creates, and the slippage between your decision price and your fill. Net edge is simply gross edge minus those costs:

net edge=gross edgeround-trip cost\text{net edge} = \text{gross edge} - \text{round-trip cost}

Worked example. Suppose a signal has a gross edge of 12 bps per trade and the round-trip execution cost (spread + impact + slippage, in and out) is 8 bps. Net per trade is 12 − 8 = 4 bps — still positive, but you just gave away two-thirds of the alpha. Now watch what turnover does. Annual return is roughly net per trade × trades per year:

VariantGross/tradeRound-trip costNet/tradeTrades/yrNet annual
Baseline12 bps8 bps4 bps500+200 bps
2× turnover (same signal)12 bps8 bps4 bps1,000+400 bps
2× turnover, weaker signal9 bps8 bps1 bps1,000+100 bps
2× turnover, cost-heavy name12 bps14 bps−2 bps1,000−200 bps

The arithmetic to internalize: a strategy that trades twice as often must clear twice the cost. Doubling turnover doubles the cost bill, so a gross edge that barely beat costs once gets halved in margin and can flip negative. The naive backtest hid all of this by setting the cost column to zero.

Warning:

The number that lies: gross Sharpe

Reporting a gross Sharpe — computed before transaction costs — is the cardinal sin of strategy evaluation. It rewards turnover for free: the more you churn, the better the gross number looks, even as the net result bleeds out. Always quote Sharpe net of modeled spread, impact, and slippage. If someone shows you a Sharpe without telling you the assumed cost per trade, assume it’s gross and discount it hard.

Note that this lesson’s prerequisite, Time-Series Finance, already armed you against look-ahead bias, overfitting, and data-snooping — the statistical ways a backtest lies. Here the lie is physical: execution and cost realism, not whether the signal was real to begin with.

When to worry most

Cost realism matters in proportion to turnover × order size relative to liquidity. A monthly, low-size rebalance can survive a sloppy fill model; a daily, large-size, illiquid-universe strategy lives or dies by it. Build the cost model before you fall in love with the equity curve.

Fill in the relationship that turnover imposes on a strategy.

Pick the right option for each blank, then check.

If a strategy doubles how often it trades, it must clear the total transaction cost, because cost scales with the number of trades.

Capacity & alpha decay

Analogy. A small spring feeds a stream just fine, but try to run a city off it and you’ll pump it dry. An alpha is that spring: it can water a modest book, but past some size your own buying moves the price so much that the impact swallows the edge. And springs run dry over time, too — once everyone knows where the water is, the line at the pump gets long and the flow slows for each of you.

Definition — capacity. Capacity is the maximum capital a strategy can deploy before market impact erodes its alpha to zero. The square-root law from the market-impact lesson is the governing constraint: impact scales roughly with the square root of order size relative to volume, so doubling your size doesn’t double your cost — it raises it by about √2 ≈ 1.41× per unit, and total impact cost climbs as size^1.5. Beyond capacity, every extra dollar deployed costs more in impact than it earns in signal.

Definition — alpha decay. Alpha decay is the erosion of a signal’s premium after it’s discovered. Two forces drive it: the world changes (the structural reason the edge existed weakens or disappears), and others trade it away (a published or crowded signal gets arbitraged until the premium compresses toward zero). An edge that looked like 60 bps/year in-sample can fade to a teen-digit residual once it’s public.

Alpha decays after it's discoveredPublished: t = 0
Signal premium (bps/yr)Out-of-sample
PublishedIn-sampleOut-of-sampleAverage premium (% / yr)Years relative to publication
Signal premium (bps/yr)
59.722.2
In-sampleOut-of-sample

Years relative to discovery: t<0 is the in-sample period (premium ~60 bps/yr), t=0 is publication/crowding, and the premium decays toward a small residual as the world changes and competitors arbitrage it away.

Worked example — capacity bite. Say a signal earns a gross 30 bps per trade at small size, and impact at your current $50M size costs 6 bps, leaving 24 bps net. Under the square-root law, scaling to $200M (4× size) raises impact by roughly √4 = 2×, to 12 bps; scaling to $450M (9× size) raises it by √9 = 3×, to 18 bps:

Deployed capitalSize multipleImpact cost (≈ √size)Net edge
$50M6 bps24 bps
$200M12 bps18 bps
$450M18 bps12 bps
$1.25B25×30 bps~0 bps

At 25× size the impact (30 bps) exactly eats the gross edge — that’s the capacity wall. The spring is pumped dry.

Warning:

The long-history trap

A favorite self-deception: backtest a signal on 20 years of data, report the full-sample Sharpe, and ignore that the edge only existed in the first eight years before it was discovered and crowded out. The early period props up a dead recent one. Always check whether the alpha survives out-of-sample and post-discovery — a flat or decaying recent sub-period is the tell.

When to use it

Run a capacity estimate before sizing a strategy, and re-estimate alpha decay on a rolling window in production. If the recent realized edge is drifting toward your cost floor, the signal is decaying — scale down or retire it rather than averaging it back to life with stale history.

Why does a published academic factor tend to decay even if the underlying economic story stays true?

Publication is an invitation. Once a signal is in the open, capital floods toward it: buyers bid up the cheap leg and short the expensive leg until the spread that was the premium compresses. Even if the original economic rationale (say, a risk premium) is intact, the price of that risk gets bid down as more competitors crowd in. So you get decay from crowding on top of any genuine structural change — which is why post-publication returns for famous factors routinely run a third or more below their in-sample levels.

HFT at a glance

Analogy. In high-frequency trading, the speed of light stopped being a physics trivia answer and became a budget line item. Firms lay microwave links across Illinois because microwaves through air beat fiber-optic glass by milliseconds, and a millisecond is an eternity. It’s a race where the finish line moves every time someone builds a faster route — and the prize is being first to react to the same public information everyone else also sees.

Definition. High-frequency trading (HFT) is automated trading characterized by extremely short holding periods (seconds to microseconds), very high order-to-trade ratios, flat overnight positions, and a relentless latency arms race: colocation (renting rack space inside the exchange’s data center so your server sits feet from the matching engine), microwave and laser links between venues, and hardware (FPGAs) that processes market data in nanoseconds. HFTs are the dominant liquidity providers and takers in modern markets — which means they are, quite literally, the counterparties on the other side of your algorithm’s child orders.

Why it matters to you. When your VWAP algo posts a passive limit order or crosses the spread to take one, the resting quote it interacts with was very likely placed by an HFT, and the order that fills (or fades away from) yours is reacting faster than you can. You are not trading against a sleepy human — you’re trading against the fastest, best-informed participant in the room.

Which feature is the defining hallmark of high-frequency trading rather than ordinary algorithmic trading?

HFT strategies & adverse selection

Analogy. Picture a market maker as a shopkeeper who’ll buy or sell at posted prices all day, earning the markup (the spread). Most customers are noise — they buy and sell for reasons unrelated to where the price is going. But every so often a customer walks in who knows the warehouse next door just burned down: they’ll only buy from you right before the price jumps. That informed customer is adverse selection, and the shopkeeper’s whole job is to earn enough from the noise traders to survive the informed ones.

Definition. The major HFT strategy families:

  • Electronic market making. Continuously quote both a bid and an ask, earning the spread when both sides trade. The two risks are inventory risk (you accumulate a position you didn’t want and must hedge or unwind) and adverse selection (your quote gets picked off by a faster, better-informed trader right before the price moves against you).
  • Latency arbitrage. Detect a price change on one venue (or in a related instrument, like a future) and trade the slower-to-update venue before it reprices — profiting from being microseconds ahead of participants reading stale quotes.
  • High-frequency statistical arbitrage / order anticipation. Exploit fleeting statistical relationships (a pair, an index-vs-constituents basis) or infer and front-run the predictable footprints of large, slow institutional orders.

Match each high-frequency strategy to what it actually does.

Pick a term, then click its definition.

Worked example — adverse selection on your resting limit order. You post a passive buy limit at the bid, $100.00, hoping to save the half-spread. Consider the two ways it can fill:

ScenarioWhy your bid fillsWhere the price goes nextYour outcome
Noise sellerA liquidity-motivated seller hits your bidStays near $100.00You saved the half-spread — clean win
Informed sellerA faster trader, seeing the price about to drop, dumps into your bidFalls to $99.90You bought at $100.00, now worth $99.90 — 10 bps underwater

Here’s the cruel asymmetry: when the market is about to rise, the HFT pulls the offer and your bid sits unfilled (you miss the good case); when the market is about to fall, your bid gets filled by informed flow (you catch the bad case). So your realized fills are selected toward the moments the trade was wrong. That is why taking liquidity sometimes beats posting it: crossing the spread costs a known half-spread, but posting passively can cost you the (larger, hidden) adverse-selection tax of only filling when you’d rather not have.

Tip:

Post vs. take, decided by adverse selection

The passive-vs-aggressive choice isn’t “save the spread, obviously.” It’s a trade-off: posting saves the half-spread but exposes you to adverse selection and non-fill risk; taking pays the spread but guarantees the fill and dodges the picked-off scenario. When alpha is short-lived or the name is fast, the certainty of taking often wins — the spread you pay is cheaper than the fills you’d only get when you’re wrong.

Complete the description of the market maker's core risk.

Pick the right option for each blank, then check.

A resting limit order suffers because it tends to fill exactly when a faster, better-informed trader knows the price is about to move against it.

Putting it together

A backtest is a hypothesis about the world and a hypothesis about execution. The statistical hygiene from time-series finance keeps the signal honest; this lesson keeps the fills honest. Price in the spread, model impact with the square-root law, cap your size at capacity, watch for alpha decay, and never forget that the counterparty to your every child order is a high-frequency machine that may be picking off your passive quotes faster than you can blink.

Big picture

Execution-aware backtesting & HFT

  • Backtesting & HFT
    • Cost-naive backtest
      • net = gross − cost
      • 2× turnover → 2× cost
      • never quote gross Sharpe
    • Capacity & decay
      • square-root law caps size
      • alpha decays post-discovery
      • beware long-history trap
    • HFT
      • colocation + microwave
      • speed of light as a constraint
      • your counterparty
    • Strategies & adverse selection
      • market making earns spread
      • latency arb = be first
      • posting risks getting picked off
From honest fills to the high-frequency world on the other side of your order.

Execution-aware backtesting check

Question 1 of 40 correct

A strategy backtests at +6 bps gross per trade. You model a realistic round-trip cost of 8 bps. What's the net edge, and what should you do?

Check your answer to continue.

You now have the full execution toolkit: you know the taxonomy of costs, how to schedule and minimize them, how to measure them after the fact with implementation shortfall, and — as of this lesson — how to keep a backtest from lying to you about all of it, plus who’s waiting on the other side of every order. The pieces are on the table. Next is the final exam: a single graded run across the whole course, one locked-in answer at a time, to prove you can put execution-aware reasoning together under pressure. Bring the cost model with you.

Mark lesson as complete