Agentic Trading Index

Trading execution costs: spread, commission and slippage

Trading workstation displaying charts beside a keyboard, illustrating execution costs for an automated trading agent
Photo by AlphaTradeZone on Pexels

Execution cost is the difference between the price an agent intended to trade at and the total economic cost of the completed order.

That difference is not one fee. Spread, commission, price movement while an order is in flight, market impact and unfilled quantity can all matter. A market order can pay the spread and move the book; a limit order may avoid crossing the spread but never fill. A useful cost model must reflect the order type, size, venue and market state, rather than apply one fee estimate to every trade.

Separate the costs before adding them

For a completed order, keep explicit broker charges separate from price-based execution costs. Convert both into a common unit, such as basis points of notional or cash per round trip. That makes instruments easier to compare and exposes assumptions in the agent's decision logic.

Spread is a price, not always a fee

The quoted spread is the gap between the best displayed bid and ask. A marketable buy typically pays the ask and a marketable sell typically hits the bid.

Relative to the midpoint, that is roughly half the spread for a small order that fills immediately at the top of book. The full spread is a reasonable rough estimate for a buy and sell round trip when quotes stay unchanged, but fills and quotes rarely behave so neatly.

Displayed spread is not the whole cost. A larger order can consume several price levels, while a fast quote change can make the displayed price unavailable before the request arrives. Measure the spread at the order's arrival time and record the available depth. A stale quote from the agent's data feed is not a valid execution benchmark.

Commission is explicit, slippage is contextual

Commission may be charged per share, contract, lot, order or notional. Check whether the quoted schedule is per side or round trip, and include exchange, clearing or regulatory charges where applicable. A zero commission line does not mean zero execution cost: the spread, price movement and venue conditions still count.

Slippage describes the difference between a benchmark price and the fill price. If the benchmark is the midpoint when the order reaches the venue, market-order slippage includes crossing the spread as well as impact and any adverse price movement.

Do not add the full quoted spread to that midpoint-to-fill measure. That would count some of the same cost twice.

  • Use the decision price to measure total implementation shortfall from the strategy's signal to the fill.
  • Use the arrival midpoint to measure execution against the market when the order reached the venue.
  • Track commission separately, then combine the components only after confirming their benchmarks do not overlap.

Compare typical market ranges

The table gives indicative ranges for liquid periods and modest order sizes. These are typical market ranges, not audited results for a particular broker or venue.

The spread and shortfall can widen sharply around news, market open or close, thin liquidity and volatile conditions. Commission schedules vary by account, volume and jurisdiction.

Illustrative ranges by instrument

Mid-to-fill shortfall below uses arrival midpoint as the reference for a marketable order. It includes spread crossing, so treat the spread column as context rather than an extra amount to add to shortfall. The ranges are examples for comparison, not execution guarantees.

Instrument and example sizeTypical quoted spreadTypical commissionTypical mid-to-fill shortfall
Major FX pair, 100,000 units0.1-1.2 pips$2-$7 per round trip0.1-1.0 pips per side
Liquid US shares, 100 shares$0.01-$0.03 per share$0-$0.005 per share, per side0.5-4 cents per share
Index future, 1 contractUsually 1 tick in liquid periods$0.50-$2.50 per contract, per side0.5-2 ticks
Liquid crypto spot pair, $10,000 notional1-10 basis points1-10 basis points per side2-20 basis points

These ranges are useful for initial sizing, not for a live cost budget. A $10,000 equity order can behave differently from a 100-share example, even in the same instrument. Order size relative to displayed depth, participation rate and the time allowed to execute often matter more than the instrument label.

Measure realised costs in the agent loop

Log enough information to reconstruct each order after the fact. Store the decision timestamp and benchmark, the arrival quote, order type, limit price, quantity, venue, acknowledgements, replacements, cancellations, fills and fee details. Retain quote timestamps and feed delay too. Without them, an apparent execution loss may be a stale-data problem rather than poor routing.

For each fill, calculate signed shortfall against a chosen benchmark. For a buy, a fill above the benchmark is adverse; for a sell, a fill below it is adverse. Multiply the signed price difference by filled quantity, add explicit charges and divide by notional when reporting basis points. Aggregate partial fills at fill level, not just by the final average price, so the agent can distinguish early fills from later ones.

  1. Record the strategy's decision price and the first valid arrival midpoint.
  2. Capture every fill, fee, cancel and replace, including timestamps and requested quantity.
  3. Calculate decision-to-fill and arrival-midpoint-to-fill costs separately.
  4. Group results by instrument, side, order type, size, time of day and volatility.

Review distributions, not only averages. Median shortfall can hide a small set of expensive fills that dominate a strategy's returns. Track the 90th or 95th percentile and the share of orders that remain unfilled. A passive limit order may show low cost on fills while losing opportunities when price moves away. That opportunity cost belongs in strategy evaluation, even if it is not a broker fee.

Turn the estimates into execution rules

Use observed costs to define when an agent should trade, how it should route and when it should stop trying. A market order favours completion speed but accepts uncertain price.

A passive limit order can reduce spread paid, but needs a policy for queue position, timeout and replacement. Repeatedly cancelling and resubmitting can increase fees, lose priority or chase a moving market.

Set separate thresholds for different instruments and order sizes. For example, permit marketable orders only when quoted spread is below a configured limit and top-of-book depth is sufficient for the requested quantity.

If the order would exceed that depth, split it or use a participation cap. Stop or seek fresh approval when realised shortfall exceeds the strategy's budget, the quote is stale, or fees cannot be reconciled.

Test the same rules across calm and volatile periods. Agentic paper trading at fx-tech.ai starts at $9.99 a month and can help exercise order logic before live routing, but simulated fills should not replace measurement on the target venue. The live policy still needs reconciliation against actual fills and fees.

This week, add arrival-midpoint shortfall and explicit commission to the execution log for every order your agent submits.

Frequently Asked Questions

How do I calculate trading execution costs?

Compare each fill with a clearly defined benchmark, such as the decision price or arrival midpoint, and multiply the signed price difference by the filled quantity. Add explicit commissions and charges separately, then divide by notional if you need a basis-point measure.

Does slippage include the spread?

It depends on the benchmark. Slippage measured from arrival midpoint to fill usually includes crossing the spread, so adding the full spread again double-counts part of the cost. State the benchmark alongside every slippage metric.

How can an agent reduce slippage?

Use current quotes and depth, limit order size relative to liquidity, and choose between marketable and passive orders based on urgency. Measure fill quality and unfilled quantity together, because a lower-cost order that misses the trade can still hurt strategy performance.