One operator sends a market order when a signal is strong, accepting a wider fill to avoid missing the move. Another refuses the same trade because the estimated cost exceeds its limit. Both calls can be rational. The difference is whether the agent measures cost against a defined risk budget, or treats execution as a detail that happens after the strategy decision.
For an unattended system, spread, commission and slippage affect more than reported returns. They can change position size, breach a loss limit, trigger an unsuitable retry or make a strategy behave differently across venues. A cost model therefore needs to inform order decisions and leave evidence that compliance and operations can review.
Opposite calls start with different loss models
A spread is the gap between the best quoted bid and ask. A marketable order usually pays some or all of that gap.
Commission is an explicit charge, often assessed per share, contract or notional amount. Slippage is the difference between a chosen benchmark price and the actual fill. These costs interact, but they are not interchangeable.
For instance, a buy order can have a low commission and still be expensive if it crosses a wide spread, arrives late or moves the book. A passive limit order may avoid crossing the spread, but it can sit unfilled while the market moves away. A fill can also be adverse: the order executes just before the price moves against the strategy.
Before the agent places an order, calculate an expected cost in a consistent unit, such as basis points of notional or ticks per contract. Set a maximum cost for the trade and a separate threshold for unusual conditions. Avoid treating a single average as a promise. Market state, order size, venue, time of day and urgency all change the likely result.
Put every cost on the same unit
The table gives illustrative typical market ranges for small orders in normal conditions. Actual spreads, fees and fills vary by instrument, venue, account schedule, order size and volatility. Slippage figures are per side against the arrival midpoint. They are not audited results for any broker or platform.
| Market and scope | Quoted spread, typical range | Explicit commission and fees, typical range | Slippage per side, typical range |
|---|---|---|---|
| Liquid US large-cap shares | 1-5 basis points | $0-$0.005 per share per side, excluding some exchange and regulatory charges | 1-10 basis points |
| Major FX pairs | 0.1-1.0 pips | $3-$7 per $100,000 per side on commission schedules; some pricing is spread-only | 0.1-2 pips |
| Liquid index futures | 0.25-1 tick | $1-$5 per contract per side, including typical broker and venue charges | 0.25-2 ticks |
Do not add numbers that already include one another. If slippage is measured from the decision price, it may already include spread, latency and market impact. If the system reports a component breakdown, measure spread from the midpoint, record fees from actual fills, and define slippage against a separate benchmark. Keep a second all-in measure, such as implementation shortfall from decision price to final execution, for strategy review.
For a simple example, a $100,000 equity trade with a 2 basis-point quoted spread has a spread cost of about $20 for a round trip if it crosses the spread on entry and exit. One basis point is $10 on that notional. Add commissions on both sides and slippage on each fill.
If slippage is 3 basis points per side, it adds about $60. This arithmetic is useful only if the measurement conventions are explicit and consistent.
Measure slippage as a distribution
A mean hides the cases that create operational risk. Track costs by instrument, venue, order type, side, size, time of day and volatility band. Store both expected and realised costs. Compare like with like: a passive order should not be judged against a market order benchmark without explaining the difference in fill probability and urgency.
At minimum, record these values for each order and its fills:
- Decision timestamp and decision price, so strategy delay can be measured.
- Arrival timestamp and midpoint, to separate routing and execution effects from signal delay.
- Requested quantity, order type, limit price, time in force and route.
- Each fill's price, quantity, fee and timestamp, plus any cancellation or rejection.
- Spread, slippage and total shortfall, with the benchmark and calculation method identified.
Use percentiles as well as averages. The median describes a typical trade; the 90th or 95th percentile shows how bad costs become in less favourable conditions. Set thresholds by liquidity and order size. A five basis-point cap may be reasonable for one instrument and meaningless for another. Include a minimum sample count before the agent changes its own limits from observed data.
A cost estimate is a control input, not a post-trade explanation.
Paper trading can help test whether the agent records these fields and handles rejects, partial fills and cancellations as expected. It cannot reproduce every live queue position or market impact. Agentic Trading Index offers agentic paper trading from $9.99 a month; treat simulated fills as a test of software behaviour, not proof that live costs will match.
Make the cost limit enforceable
A limit in a dashboard does not control an agent unless the order path checks it before submission. Put the check beside the code that creates or modifies orders, and make the decision deterministic. If the quote is stale, the fee schedule is missing or the estimate cannot be calculated, the safe response should be defined in advance. For a system without a human watching, that usually means reject or hold the order rather than assume zero cost.
A practical pre-trade sequence is:
- Validate instrument, trading session, quote freshness and permitted route.
- Estimate spread, fees and expected slippage using the intended order size and current market state.
- Compare estimated all-in cost with the trade limit and the strategy's expected edge after costs.
- Apply quantity, participation and exposure limits. Reduce size or reject if the cost budget is exceeded.
- Submit with an allowed order type and time in force, then reconcile acknowledgements, fills and cancellations before any retry.
- Recalculate remaining exposure and expected cost after partial fills or material price changes.
Market orders offer execution certainty, not price certainty. Marketable limit orders cap the worst acceptable price but can leave a residual position. Passive orders may reduce spread paid, but invite non-fill and adverse selection. A risk policy should state when each type is permitted, how long an order may rest, and whether repricing is allowed. Do not let a retry turn one intended order into duplicate exposure.
Use both a per-order cost cap and aggregate controls. An agent that repeatedly submits individually acceptable orders can still create excessive turnover, fees or market impact.
Monitor daily costs against a budget, and stop or reduce activity when costs exceed a limit over a defined window. Keep that control separate from a strategy's stop-loss: execution costs can rise even when the market price has not moved far enough to trigger the stop.
Keep evidence for compliance and review
Cost controls need an audit trail that explains what the agent knew when it acted. Persist the input quotes, fee schedule version, model version, benchmark, estimate, limit and decision.
Then retain broker acknowledgements and fill reports so expected cost can be compared with realised cost. Use synchronised timestamps and consistent units; otherwise a post-trade review may attribute a latency loss to the wrong component.
Set alerts for repeated cost-limit breaches, unusual fee changes, widening spreads, high rejection rates and gaps between expected and realised shortfall. A single poor fill may be noise.
A sustained shift can indicate a market regime change, a broken feed, a routing change or a faulty cost model. Define who or what can pause the strategy, how it resumes, and which records are retained under the relevant policy.
This separation matters for compliance. The strategy should not silently loosen its own limits to keep trading. Changes to thresholds, eligible venues and order types should be versioned, authorised and reviewable.
In development, test the block path as carefully as the successful order path. Include stale data, missing fees, partial execution and market gaps in the test cases.
This week, add a pre-trade cost check that logs its estimate and blocks orders when required inputs are stale or the approved limit is exceeded.
Frequently Asked Questions
How should a trading agent calculate cost of execution?
Estimate spread, explicit fees and expected slippage on a common unit, such as basis points of notional or ticks. Define each benchmark so costs are not counted twice, then compare the all-in estimate with a configured limit before submission.
What is a good slippage benchmark for an agent?
Use the decision price to measure overall implementation shortfall, and the arrival midpoint to assess execution after the order reaches the market. Record the benchmark and timestamp with every order, since the two measures answer different questions.
Should an agent use market or limit orders to reduce execution costs?
Neither order type is always cheaper. Market orders prioritise execution but expose the agent to uncertain prices; limit orders cap price but can remain unfilled or receive adverse fills. The agent's rules should account for urgency, fill probability, exposure and its cost limit.