Agentic Trading Index

Cost of execution for trading agents: a 30-day plan

Trading terminal with order book and execution figures illustrating the cost of execution for an automated agent
Photo by Rafael Minguet Delgado on Pexels

One operator sends market orders to capture signals immediately. Another uses passive limit orders to avoid crossing the spread. They have made opposite calls on execution cost: the first accepts visible fees and slippage; the second accepts missed fills, queue uncertainty and exposure while waiting. Neither choice is automatically cheaper. The right comparison is the realised cost of each policy on the same instrument, order size and market conditions.

For an agent without a human watching, this is an engineering measurement, not a line in a broker's price list. Spread, commission and slippage affect each fill differently.

So do rejected orders, partial fills, market impact and the delay between a signal and a broker acknowledgement. A strategy that expects 5 basis points (bps) per trade has little room for error if its typical round trip costs 3 bps.

Define the cost before measuring it

Start by choosing a reference price and a unit. For a marketable order, arrival mid-price is a useful baseline: the midpoint of the best bid and offer when the agent decides to send. Measure buys as fill price minus arrival mid, and sells as arrival mid minus fill price. Positive values are costs. Convert the result to bps of filled notional so that instruments and order sizes can be compared.

Keep the components separate. The quoted spread is the distance between bid and offer, but a market order measured against the midpoint pays roughly half the spread on entry in a stable, liquid book. A round trip can therefore pay about one full spread, before fees and any price movement.

Commission is the explicit broker or venue charge. Slippage is the difference between the chosen reference price and the execution price after accounting for the spread component. State the convention in code and reports, or costs will be double-counted.

For limit orders, do not report a zero spread cost just because the fill was at the bid or offer. The agent may have waited through an adverse move, missed a fill and entered later at a worse price, or received a fill just before the market moved against it. Compare the actual policy with a stated benchmark, such as immediate execution at arrival, and record unfilled opportunities separately.

Build a cost ledger

Capture order-level evidence

Store decision time, send time, broker acknowledgement time, each fill time, price, quantity, fee, side, order type, limit price and instrument. Also save the bid, offer and midpoint at decision and submission, plus a market-data timestamp.

A quote that is stale by 400 milliseconds can make a fill look unusually poor or unusually good. Preserve the raw values; derived cost fields can be recalculated later.

Join events with a stable client order ID and a unique fill ID. One order may have multiple fills, and commission may be charged per fill or per order. Reconcile quantities and fees against broker statements daily.

Log cancels, rejects, replaces and timeouts too. A request that times out after reaching the broker can still fill, so the eventual execution belongs in the ledger even if the agent did not see the response promptly.

  • Record both exchange or broker timestamps and the agent's local timestamp.
  • Store intended quantity, filled quantity and remaining quantity separately.
  • Keep gross price movement, explicit fees and spread estimates as distinct fields.
  • Mark market state, including volatility, spread width and time of day.

Use ranges as a sanity check

The figures below are indicative typical ranges for liquid instruments in ordinary conditions, expressed in bps of notional. They are not audited figures for a particular broker or venue.

Spread is the full quoted spread; commission is per side; slippage is adverse movement beyond the spread component for a single fill. Thin books, news, larger orders and different fee tiers can exceed these ranges.

Market and typical instrumentQuoted spread, typical rangeCommission, per side, typical rangeSlippage per fill, typical range
Liquid US large-cap shares1-5 bps0-1 bps0.5-5 bps
Major FX pair, such as EUR/USD0.2-1.5 bps0.2-0.7 bps0.5-5 bps
Liquid BTC/USD spot market1-10 bps1-10 bps1-20 bps

These ranges are for orientation, not a substitute for measuring the intended account and order size. Venue rebates, minimum fees and currency conversion can change the effective rate. A fee quoted per share, lot or contract should be converted using actual filled notional, not the requested notional.

Run the 30-day implementation plan

Days 1-7: instrument and reconcile

On day one, choose a benchmark, define the cost formula and add the ledger fields before changing execution behaviour. Test that the agent can join decisions, orders, fills and fees without duplication. Build a daily reconciliation that flags missing fills, fee mismatches and quantities that do not net to the position change.

For the first week, collect live or paper executions without treating paper fills as evidence of live cost. A simulator may not model queue priority, partial fills, latency or market impact.

Record the market-data and broker timestamps so the difference between signal time, order arrival and fill is visible. For platform research, maintain a separate record of API and routing terms alongside resources such as FX-Tech.

Days 8-30: compare policies at fixed size

Choose one instrument and a realistic order size. Compare a marketable policy with a passive limit policy on the same signals, using matched time windows where possible. Do not send duplicate live orders just to create a comparison.

Replay recorded market data for the counterfactual, then label that result as simulated rather than observed. A paper environment is useful for checking order logic, but its fill model should not be used as a live-cost estimate.

Review results each day, but set the evaluation period in advance. Thirty days often gives a usable first view across sessions and ordinary market conditions; it will not cover every volatility regime.

Segment the results by instrument, order size, time of day, volatility and order type. Report median, 90th percentile and sample count, not only the mean. A small number of costly fills can matter even when the average looks acceptable.

  1. Compare spread paid, explicit fees and slippage separately, then calculate all-in cost per filled order and round trip.
  2. Measure fill rate, time to fill, partial-fill rate and cancellation rate for each policy.
  3. Estimate missed-trade cost for passive orders using the strategy's stated benchmark, not an assumed perfect fill.
  4. Repeat the comparison at the intended size. Cost can rise faster than notional when the order consumes several levels of the book.

Set a minimum sample before drawing a conclusion. If a segment has only 12 fills, label it low confidence rather than comparing its 90th percentile with a segment that has 1,000. Where the agent trades several products, keep the analysis per product first. Aggregated costs can hide one instrument whose fees or liquidity make the strategy uneconomic.

Turn measurements into order controls

Use measured costs to adjust decisions, not to make the agent blindly avoid all marketable orders. A market order may be sensible when a signal decays quickly and the expected edge comfortably exceeds spread, fees and likely slippage. A passive order may suit a slower signal, but the decision needs a maximum wait time and a rule for what happens when it remains unfilled. Track opportunity cost alongside execution cost so that waiting is not treated as free.

Before sending an order, estimate the all-in cost at its size from recent observations. If the estimate exceeds the strategy's cost budget, the agent can reduce size, switch order type, wait for a better market or skip the trade. These choices need explicit limits.

For example, cap a marketable order at a defined fraction of displayed depth, reject quotes older than a configured age, and cancel a passive order when its signal expires. Log the reason for each change so that later analysis can distinguish cost control from signal failure.

Recompute the cost model on a fixed schedule and after material changes to fees, routing, instruments or order sizes. Alert on drift in the median and 90th percentile, not just a single expensive fill. Keep a separate threshold for missing or delayed market data: an agent should not rely on a cost estimate built from a quote it cannot verify. For a practical platform comparison, record what each API exposes about fills, fees, timestamps and order state, then compare that evidence with the agent's own logs.

Use the measured distribution to set a cost budget per strategy and a stop condition for repeated breaches. A budget is not a promise that every order stays inside it. It is a rule for when to reduce risk, pause trading and inspect the cause. Check whether your own expected net edge after execution costs remains positive; the threshold is 0.0.

Frequently Asked Questions

How do I calculate execution cost for a trading agent?

Choose a reference price, such as the midpoint when the agent decides to send, and compare it with each fill. Convert the price difference and explicit fees into basis points of filled notional, keeping spread, commission and slippage separate to avoid double-counting.

How many days of live trading data do I need to estimate slippage?

Thirty trading days can provide an initial estimate across ordinary sessions, but it may not capture unusual volatility or low-frequency conditions. Report sample counts and percentiles, and segment results by instrument, size, time and market state.

Are paper-trading fills accurate enough to estimate execution costs?

Paper fills can test order logic, but often do not reproduce queue priority, latency, partial fills, fees or market impact. Treat them as simulated evidence and compare their assumptions with reconciled live fills before using them to set a cost budget.