What does a market order actually pay?
| Ask price | Shares offered |
|---|---|
| $100.05 | 300 |
| $100.10 | 500 |
| $100.15 | 800 |
| $100.25 | 1,500 |
- 200 shares: all fill at 100.05, a cost of 5 basis points: half the spread.
- 1,000 shares: 300 at 100.10 and 200 at 100.095, a cost of 9.5 basis points.
- 2,500 shares: through the fourth level. Average $100.164, a cost of 16.4 basis points.

Why measure cost against the mid?
You need one fixed reference price chosen before you trade, or you cannot compare decisions. Three references are common:
- The mid at decision time, as above. It charges you for half the spread and for any impact.
- The best quote, here $100.05. It shows only the impact beyond the touch and makes small orders look free.
- The arrival price used in implementation-shortfall accounting: the mid when the decision was made. It also charges for the price drifting while you work the order.
Say which reference you use. A cost of 5 basis points against the mid and zero against the best ask describe the same fill.
When is a limit order better?
Put that into a simple model. Rest a buy at p1 - p100.12, a cost of 12 cents. Buying now at the ask costs 5 cents. The expected cost of waiting is
which beats 5 cents only when .

The useful lesson is the shape, not the specific numbers. Waiting is worth it when fills are likely and the cost of missing is small. It is a bad trade when the price tends to run away from unfilled orders.
Why do limit orders get filled at the worst times?
The model above treats the fill as a coin flip, independent of where the price goes next. In real markets it is not.
A resting buy order is most likely to fill when sellers are pushing the price down. Some of those sellers may know something you don't. So, conditional on being filled, the price tends to keep falling. When the price rises instead, your order sits there unfilled and you chase. This is adverse selection, the same force a market maker faces: the trades you get are biased towards the ones you would rather not have.
Measured properly, a limit order's saving is the spread captured minus the adverse move after fills, minus the cost of chasing misses. Research on execution consistently finds that the headline saving shrinks once those effects are counted.
How does order size change the decision?
For a small order the choice is mostly about the spread. For a large one, impact dominates. Empirical studies of large institutional trades find that impact grows roughly with the square root of order size relative to daily volume (Tóth et al., 2011). Doubling the size raises the cost per share by about 40%, not 100%.
That non-linear impact is why large orders are split over time. Execution algorithms balance two costs:
- Trading fast pays more impact.
- Trading slowly leaves the order exposed to the price drifting in the meantime.
Common mistakes
- Using the best quote as the cost of a large order. Walk the book: the average fill, not the top price, is what you pay.
- Ignoring missed fills in a backtest. Assuming every limit order fills at its price makes passive strategies look far better than they are. Model fills explicitly, with queue position and adverse selection.
- Comparing costs with different references. Basis points against the mid and against the arrival price are different numbers.
- Forgetting fees and rebates. Many venues charge takers and pay makers. That can tilt the decision but rarely reverses a large adverse move.
Where to go next
- Trading costs and slippage in backtesting
- Market making with Python and public order book data
- What is market making? A quoting game in five stages. Try the other side of the trade in the market making game.
- The transaction cost models lesson.