Agentic Trading Index

Backtesting vs forward testing across agent test stages

Trading workstation displaying price charts during backtesting and forward testing of an agent strategy
Photo by AlphaTradeZone on Pexels

Two operators, opposite calls

One operator approves an agent after a backtest shows a 1.4 Sharpe ratio and a 12 per cent maximum drawdown. Another operator pauses the same strategy after a week of forward testing: a stale quote caused a market order to fill 18 basis points away from its signal price, and a retry duplicated an order. Both calls can be rational. They are answering different questions.

Backtesting asks what a defined strategy would have done on historical data under a model of execution. Forward testing asks what the running system does with data arriving now, actual API behaviour and changing account state.

For an agent that can place orders without supervision, the second question includes more than whether the signal makes money. It includes whether the agent understood its position, respected its limits and recovered safely when a request timed out.

The comparison is not a choice between old data and new data. A backtest is useful for rejecting weak ideas and finding failure conditions.

Forward tests expose the assumptions that a historical simulation cannot verify. Neither makes the other redundant.

A profitable backtest tests a strategy model. A forward test also tests the machinery that turns a decision into an order.

That distinction matters because a strategy may trade only a few times a day, while its software handles quotes, retries, cancellations, restarts and partial fills continuously. Agentic paper trading, including services available through an agentic paper trading environment, can exercise some of that machinery before live capital is involved. It cannot make a simulated fill equivalent to an exchange fill.

What each method can observe

A historical test can replay years of prices quickly and cheaply. It can compare parameter sets, market regimes and asset universes, provided the data is point-in-time and the simulation records realistic costs. It is particularly good at finding obvious fragility: returns concentrated in one instrument, excessive turnover, sensitivity to a small parameter change or losses in a volatility regime absent from the training period.

It cannot directly establish what a broker API will return during a live outage, how a venue will queue an order, or whether an agent will misread an error and submit again. Those events can be modelled, but the model is an assumption until tested against observed behaviour. Historical bars also hide the order of events inside each interval. If both a stop and a profit target fall within one one-minute candle, the backtest needs a declared rule for which occurred first, or finer-grained data.

Forward testing has several forms, and they expose different evidence:

  • Paper trading sends simulated orders through a broker or platform environment. It exercises request construction and parts of account-state handling, but fills, fees and rejection rules may be simplified.
  • Shadow execution consumes live market data and records the orders the agent would send, without submitting them. It tests timing and decision flow, but cannot measure actual queue position or fill quality.
  • Small live trading submits real orders at reduced size. It observes real acknowledgements, partial fills, fees and slippage, while putting capital at risk. A small size may still behave differently from a larger order in a thin book.

Forward tests take calendar time. A strategy that trades twice a week will not generate a useful execution sample in a two-day test. A short test can still catch a broken authentication refresh or a state mismatch, but it cannot support a strong claim about long-run profitability.

Build a test that compares like with like

Start by fixing the rules and the system version. Record the strategy parameters, model or prompt version, instrument universe, market-data source, timezone, fee schedule and risk limits. Store every decision with the quote timestamp, the data actually available to the agent, the intended order, the response and the resulting position. Without that record, a difference between test modes may be impossible to explain.

Keep a final historical period untouched while developing the strategy. Use walk-forward windows rather than repeatedly tuning against the same holdout.

Check survivorship and delisted instruments, corporate actions, contract rolls and point-in-time constituents where relevant. A test using today's surviving symbols to represent a past universe can overstate performance before execution costs are considered.

Then run the forward test from the same decision rules, not a hand-edited copy. Compare signals and orders at the point they were generated.

A production agent may see a different quote from the one in a historical bar replay because of latency, market-data consolidation or clock drift. Log both the event time and the time the agent received the event.

A practical sequence is:

  1. Validate data handling and deterministic strategy logic on historical replay.
  2. Run out-of-sample periods with realistic fees, spread, financing and borrow assumptions.
  3. Run paper or sandbox orders to check authentication, order schemas, state updates and recovery paths.
  4. Run shadow execution on live data and compare intended orders with the historical simulation's decisions.
  5. Use a capped live allocation only after the earlier stages pass, then compare expected and realised fills before increasing size.

For each stage, define a pass condition before seeing the result. Examples include no unexplained position mismatch, no duplicate order after a timeout, and a maximum permitted difference between expected and realised costs. A test that keeps changing its acceptance rule until it passes is a development exercise, not validation.

Measure the gap, not just returns

The figures below are indicative typical ranges for liquid instruments and common retail or broker API workflows. They are not audited results for any provider.

Asset, venue, order type, network location and market conditions can move them substantially. Treat them as planning ranges, then measure the actual setup.

Test modeTypical observation delayTypical cost or fill evidenceBest use
Historical bar replayMilliseconds to seconds per simulated decisionModelled spread often 0.5 to 3 basis points in liquid markets; no real queue evidenceScreening, regime checks and parameter sensitivity
Broker paper or sandboxAbout 50 to 500 milliseconds for an API responseSimulated fills may assume 0 to 2 basis points of slippage; fill rules varyRequest handling, account state and basic recovery
Live-data shadow modeAbout 20 to 250 milliseconds from feed receipt to logged decisionIntended price can be compared with later market prices, but no actual fillSignal timing, stale-data checks and decision parity
Small live ordersAbout 20 to 300 milliseconds for acknowledgement on a stable routeRoughly 0 to 10 basis points of slippage in liquid conditions; tails can be largerActual fills, rejects, fees and live state reconciliation

These figures are not interchangeable measures. API acknowledgement latency is not time to fill.

Acknowledgement means the broker accepted or received a request, not that the market filled it. Record at least decision time, send time, acknowledgement time, fill time and cancellation time. For a limit order, also record whether it was marketable at submission and how long it rested.

Compare execution on a common basis. For each order, calculate the difference between the decision price and the volume-weighted average fill price, in basis points, with buys and sells signed consistently.

Break results down by order type, instrument, time of day, volatility and order size relative to displayed liquidity. A single average can conceal a few costly tail fills. Track operational failures alongside performance:

  • Duplicate submissions and unexplained position mismatches.
  • Rejected orders, partial fills and cancellations that remain open.
  • Stale quotes, missing events and clock drift between services.
  • Retries that exceed a risk limit or act on outdated account state.
  • Differences between simulated fees and the broker statement.

A paper-trading tool can make these checks repeatable, but confirm which behaviours it simulates. Paper-trading options for agents start at $9.99 a month. Price alone does not establish whether a platform reproduces partial fills, rejected requests, rate limits or venue-specific order rules. Test those features against the system requirements rather than assuming sandbox fidelity.

Choose the evidence required for live orders

Do not use one Sharpe ratio as the gate from research to unattended execution. A strategy can pass a return test and fail a control test.

Set separate thresholds for strategy evidence, execution evidence and operational safety. The required sample depends on turnover: 200 independent trades may be informative for a frequent strategy, while 20 trades across different regimes are weak evidence for a low-frequency one.

Use a staged decision:

  • Backtest gate: results survive out-of-sample periods, plausible cost stress and modest parameter changes.
  • Forward gate: the agent's decisions match expected logic, fills and fees stay within declared tolerances, and state remains reconciled.
  • Live gate: position caps, order limits, kill conditions and alerting work under real credentials and real account state.

Keep the first live allocation small enough that a control failure is affordable, but large enough to exercise the intended order types. A tiny order in a liquid product may test API flow while telling little about market impact at planned size.

Increase size only after comparing realised slippage and fill rates with the predeclared ranges. Pause automatically if data goes stale, position state cannot be reconciled, loss limits are reached or order acknowledgements stop arriving.

Backtesting helps decide whether a strategy deserves more testing. Forward testing helps decide whether this version of the agent, connected to this route, can be trusted with a constrained live allocation. The relevant evidence is a trace from signal to position, not a paper profit curve. Check your agent's duplicate-order count across its last 30 days of replay and forward tests. The number should be 0.

Frequently Asked Questions

How long should a trading agent forward test run?

Run it long enough to cover the strategy's normal trade frequency and relevant market conditions. A few days can expose API and state-handling faults, but a low-frequency strategy may need several weeks or months to produce a useful sample.

Can paper trading validate a strategy's profitability?

Paper trading can test decisions and some order workflows, but simulated fills and costs may differ from live execution. Use historical out-of-sample tests for broader strategy evidence, then compare paper results with small live orders before relying on profitability estimates.

What should I compare between backtesting and forward testing?

Compare signals, intended orders, fills, fees, slippage and resulting positions using the same timestamps and strategy version. Also compare operational events such as rejects, retries, stale data and position mismatches.

When is a trading agent ready for live orders?

It should pass predeclared strategy, execution and operational checks, including position reconciliation and recovery from timeouts. Start with a capped allocation and increase it only when realised costs and failure rates remain inside documented limits.