"What will this trade really cost once the agent is live?" For a 1,000-share order in a liquid US stock, a reasonable model might put the round-trip cost near $40 before market movement and some regulatory fees. That estimate depends on the quoted spread, commission and how far the fills move beyond the touch. Treat those as separate inputs, or the agent can mistake a cheap-looking fill for a cheap trade.
Consider an agent that buys 1,000 shares at an arrival midpoint of $50.00, then sells them later at the same midpoint. The displayed bid and ask are $49.99 and $50.01.
Assume the buy and sell each fill half a cent beyond the displayed touch, and the broker charges $0.005 per share per side. The cost model is:
- Spread: one cent from midpoint to touch on each side, or $20 across 2,000 shares traded.
- Additional slippage: half a cent beyond the touch on each side, or $10.
- Commission: half a cent per share per side, or $10.
The estimate is $40. Against the $50,000 one-way notional, that is 8 basis points.
State the denominator in every report: dividing by $100,000 of round-trip turnover would produce 4 basis points and could make comparisons misleading. This example assumes no change in the stock's midpoint between the buy and sell. A real round trip also has market exposure, which is not an execution fee.
Separate the cost components
The spread is the gap between the best displayed bid and ask. A marketable buy usually pays the ask, while a marketable sell usually receives the bid. If the benchmark is the midpoint, a one-cent spread costs roughly half a cent per share on each side when the market is stable. The spread can widen between decision time and order arrival, and displayed size may be too small to fill the whole order.
Commission is the broker's explicit charge. It can be a fixed amount per order, a per-share or per-contract fee, or a percentage of notional.
Check whether the quoted rate includes exchange, clearing and regulatory charges. Rebates for adding liquidity can reduce explicit fees, but they do not make an unfilled limit order equivalent to a completed trade.
Slippage needs a defined benchmark. For an agent, record the midpoint or executable quote when the strategy decides to trade, then compare that price with each fill. If slippage is measured from the midpoint, it already includes the spread crossed. If the model separately adds spread and slippage beyond the touch, as in the example above, it must not count the spread twice.
Market impact is the price movement caused by the order itself. It can appear as worse prices across multiple fills, or as the market moving while the agent works the order. A 100-share order and a 10,000-share order can face the same quoted spread but very different impact. Participation rate, volatility, time of day and available depth all matter.
Compare typical market ranges
The figures below are typical market ranges for small orders during ordinary liquidity, not guaranteed quotes or audited results for any provider. They are starting assumptions for a model. Instrument, venue, account tier, order size and market conditions can move costs outside these ranges.
| Instrument | Typical quoted spread | Typical commission | Typical additional slippage |
|---|---|---|---|
| Liquid US shares | $0.01 to $0.05 per share | $0 to $0.005 per share per side | $0.005 to $0.03 per share per side |
| Liquid equity index futures | 1 tick in normal conditions | $0.50 to $2.50 per contract per side | 0 to 2 ticks per side |
| Major FX pairs | 0.1 to 1.0 pips | $0 to $3.50 per standard lot per side | 0.1 to 1.5 pips per side |
These units are not directly comparable. A pip's cash value depends on the currency pair and position size. Futures tick values differ by contract.
Share costs scale with filled quantity. Convert each component into the account's reporting currency and a common basis, such as basis points of one-way notional, before comparing instruments or strategies.
Order size changes the usefulness of any range. A practical first check is the order's participation in recent traded volume. If an agent submits 2,000 shares into a market trading 20,000 shares in the relevant interval, it represents 10 per cent of that interval's volume. A typical small-order slippage assumption is unlikely to describe that execution. Reduce size, extend the execution window or model the expected impact explicitly.
Build the cost calculation into the agent
Store the inputs and calculate costs from fills, not from the order request alone. A cancelled order has no completed quantity, while a partially filled order has both execution costs and remaining exposure. Use a consistent order and fill identifier so retries do not create duplicate cost records.
- Capture the decision benchmark. Save a timestamp, instrument, side, intended quantity and midpoint or executable quote when the strategy creates the order. Use a clock synchronised closely enough to compare this snapshot with venue events.
- Record each fill. Store fill price, quantity, fees, venue and timestamp. Reconcile cumulative fills against the broker's order state. Do not infer a fill from an acknowledgement or from the agent's own submitted price.
- Calculate implementation shortfall. For a buy, compare fill prices with the decision benchmark; reverse the sign for a sell. Multiply each price difference by filled quantity, then add explicit fees. Keep any spread and impact decomposition separate from this total so reports remain auditable.
- Compare expected and realised cost. Group results by instrument, order type, size relative to volume, time of day and volatility. Update assumptions only after enough observations to distinguish a pattern from noisy individual fills.
- Apply a response rule. If realised cost exceeds a configured threshold, stop increasing order size, pause retries or switch to a safer execution policy. Log the trigger and the state transition so an operator can reconstruct what happened.
For a marketable order, the agent trades execution certainty for a higher chance of crossing the spread and moving through the book. A limit order can improve the price or reduce fees on some venues, but it introduces non-fill risk.
If the strategy's signal expires before the order fills, the missed trade has a cost too. Model that separately from fees and realised slippage rather than assigning a zero cost to every unfilled limit order.
Test the estimate against live behaviour
Replay the same order policy against historical quotes and trades, then compare its assumptions with a controlled paper-trading run and small live orders where appropriate. Paper fills are estimates, not proof that a venue would have filled the same queue position. Record the assumptions behind each run, especially latency, available depth, partial-fill behaviour and cancellation timing.
For a useful comparison, report at least these measures:
- Spread paid, measured against the midpoint at the decision or arrival time.
- Price movement beyond the touch, kept distinct from spread.
- Commission and other fees, shown in currency and as basis points.
- Fill rate, time to fill, partial-fill rate and cancelled quantity.
- Realised cost by order size and participation rate, not only as one average.
Put a maximum order size and a maximum acceptable execution cost in configuration, not as constants buried in strategy code. Make the agent stop or escalate when market data is stale, the broker returns an unknown order state, or actual costs breach the rule. A retry should first check whether the original order is still working. Otherwise, a recovery path can double exposure while appearing to solve a timeout.
Run those checks with the same event and fee accounting intended for production. [FX-Tech's agentic paper trading](https://fx-tech.ai/) starts at $9.99 a month and can provide a setting for exercising an agent's order handling before live capital is involved. The useful output is not a single simulated cost figure. It is a trace that shows what the agent expected, what it submitted, what filled and how the cost changed as conditions moved.
When reviewing the model, start with the component most likely to be wrong for the strategy. A liquid-share agent trading small orders may be dominated by fees or spread.
A larger order may be dominated by impact. A patient limit-order strategy may instead lose value through missed fills. Keep these components visible, then recalibrate them with execution records rather than treating one blended estimate as a stable property of the market.
Check the agent's measured implementation shortfall in basis points over its last 100 completed orders.
Frequently Asked Questions
How do I calculate trading execution costs?
Choose a consistent decision or arrival benchmark, then measure each fill's price difference from it, adjusted for buy or sell direction. Add explicit commissions and applicable fees. Keep spread and impact breakdowns separate if the total already measures shortfall from the midpoint.
Does slippage include the spread?
It depends on the benchmark. Slippage measured from the midpoint includes the spread crossed. If a model adds spread separately, define slippage as movement beyond the displayed touch to avoid double counting.
How can an agent reduce slippage?
Use order sizes that reflect available depth and recent volume, and set limits on price movement, participation and retries. Limit orders may reduce immediate spread costs, but can leave the agent unfilled while the signal or market changes.
What execution-cost data should a trading agent log?
Log the decision benchmark and timestamp, order parameters, acknowledgements, each fill, fees, cancellations and final order state. Include instrument, venue and market conditions so realised costs can be grouped by size, order type and liquidity.