The Gap Between Deciding and Getting Filled
In the last lesson we looked at what strategies decide to trade. This one is about what happens after the decision — the messy, physical business of turning "buy 100 shares" into shares you actually own. What trips up almost everyone is this: the price your algorithm saw and the price it ends up paying are often not the same. The market moves in the fraction of a second your order is travelling, so you get filled a little higher (when buying) or a little lower (when selling) than you expected. That difference has a name — slippage — and it's the everyday tax on being a moment too late.
There's a core trade-off here, covered in depth in the Order Types course. A market order says "fill me right now at whatever the going price is" — you get certainty that it happens, but not certainty of the price. A limit order says "only fill me at this price or better" — you get certainty of the price, but not that it happens at all. At human speed that's a shrug. For an algorithm firing thousands of orders a day, that choice between certainty of execution and certainty of price compounds into real money.
The one-sentence version
The price on the screen is an invitation, not a promise. Between the instant an algorithm decides and the instant the order fills, the market keeps moving — and that gap is where execution costs quietly live.
How the Market Is Actually Wired
When you picture "the stock market," you probably imagine one building where all the trading happens. It isn't one place — it's a web of competing venues. A single stock trades on many exchanges at once, plus private venues called dark pools where large orders can be matched without showing their hand to everyone. When your order leaves the broker, a step called order routing decides which of these venues to send it to, trying to find the best available price.

To keep that fair, U.S. rules define the NBBO — the National Best Bid and Offer — which is simply the highest price anyone is currently willing to buy at and the lowest price anyone is willing to sell at, across every exchange's publicly displayed quotes. Dark pools don't post quotes, so they don't set the NBBO — but they must fill trades at or within it. Think of the NBBO as the single scoreboard stitched together from a dozen scattered games. One common way retail orders get routed is payment for order flow: a broker sends its customers' orders to a wholesale trading firm that pays the broker for that flow and fills the orders. That's simply a description of a routing arrangement that exists — how it's structured, not a judgment about it.
Latency and the Race to Be First
Every order takes time to travel — from the algorithm, through the broker, across cables, to the venue. That delay is latency, and for most of the market it's measured in comfortable milliseconds nobody sweats over. But for a small group of high-frequency trading firms, whole strategies live or die on being a few millionths of a second faster than the next firm. They pay to place their servers in the same building as the exchange's computers (called co-location) and use the straightest possible fibre routes, all to shave microseconds off the trip.
An arms race most people sit out
The microsecond race is a genuine competition — but it's an expensive, specialised arms race that a handful of firms fight over razor-thin margins. The vast majority of trading strategies don't win it and don't need to enter it. If a strategy only works when you're the fastest computer in the room, you've picked a fight against people with far deeper pockets. Most useful ideas historically have an edge that has nothing to do with raw speed.
Why Big Orders Cost More to Execute
At any moment there's only so much stock on offer at the best price. The list of everyone waiting to buy and sell, stacked by price, is the order book, and the sliver between the best buy and best sell price is the bid-ask spread. A small order fills inside that top layer and barely disturbs anything. A large order is different: it eats through the shares available at the best price, then the next-best, then the next — each layer a little worse. This is called market impact, and it means a big order effectively pushes the price against itself as it fills.
How much this hurts depends on liquidity — how deep the order book is. A heavily traded stock has a deep book, so even a big order climbs only a few layers. A thinly traded one has a shallow book, where the same order can move the price sharply. That's exactly why professionals rarely dump a large order in one go: they slice it into many small child orders spread over time, feeding it in gently so it blends with normal trading instead of stampeding the price.
A Worked Example: The 10,000-Share Order
Let's make this concrete with a single stylised order — all numbers here are illustrative, chosen to show the shape of the effect, not real quotes. Say an algorithm wants to buy 10,000 shares of a stock showing $50.00 on screen. Only the first couple of thousand shares are available at $50.00. To buy the rest, the order has to climb the book: the next slice fills at $50.03, then $50.07, and so on, each block a little pricier than the last. To see the effect clearly, the chart below plots the extra each slice pays above that $50.00 screen price, in cents per share:
Illustrative only. One 10,000-share buy order filling in five slices as it climbs the order book. Each bar is how much more that slice paid than the $50.00 screen price: the first slice fills right at $50.00 (0¢ extra), the last at $50.20 (20¢ extra). The climbing bars are market impact — the order pushing the price against itself as it eats through liquidity.
Average all five slices together and the order fills at roughly $50.08 per share, not the $50.00 on the screen — about eight cents of slippage on every share, driven entirely by the order's own market impact. Eight cents sounds tiny, but across 10,000 shares that's around $800, and it happened before the trade could possibly "work." This is the everyday face of the two ideas in this lesson: the screen price was an invitation, and a big order is heavy enough to move the very price it's chasing. It's also why slicing, patience, and honest cost estimates matter as much to a serious system as the strategy that decided to trade in the first place.
Sources & Further Reading
- Concept Release on Equity Market Structure (2010) — U.S. Securities and Exchange Commission
- Findings Regarding the Market Events of May 6, 2010 (the "Flash Crash") — Joint CFTC-SEC staff report
Educational use only
Educational content only. StockCram isn't a broker or adviser, and we have no affiliation with any institution or tool we mention. Nothing here is a recommendation to trade in any particular way.
