Backtesting & Replay

Backtesting runs a strategy over historical data and reports the simulated portfolio, orders, trades, and performance. Use it to reject weak ideas, find hidden assumptions, and compare revisions—not to predict returns.

Before you run

Confirm the strategy’s assets, bar size, date range, initial capital, entry and exit rules, position sizing, and protective orders. A small change to any of these can materially change the result.

Historical depth and daily backtest usage depend on account access. The live feature-access response is authoritative for your account; the public Pricing page summarizes the standard plans.

Reading the result

Return and earnings

Outcome
Measure change in the simulated portfolio. Compare the same dates, capital, and assumptions when judging revisions.

Maximum drawdown

Downside
Shows the largest peak-to-trough decline in the tested equity curve. It does not describe every path or future loss.

Sharpe, Sortino, and Calmar

Risk adjusted
These ratios compare return with volatility, downside variation, or drawdown. Treat them as context, not a pass/fail score.

Trades and win rate

Sample
Trade count, win rate, expectancy, orders, and round trips help reveal whether the result depends on a few events or a repeatable pattern.

The equity chart supports range selection. When you select a period, Astral can recalculate the visible-period summary so you can compare regimes within the same run.

Analysis

Open Analysis from a completed backtest for grouped performance, risk, and trade metrics plus supporting charts. Inspect metric definitions and data availability: some fields depend on the returned result and may be unavailable for a particular run.

Useful questions include:

  • Did one period or one symbol produce most of the profit?
  • Is drawdown concentrated in a specific market regime?
  • Are there enough completed trades to support the conclusion?
  • Do average gains compensate for average losses and frequency?
  • Does the strategy remain plausible after less favorable assumptions?

Bar Replay

Open Replay to move through historical bars and inspect strategy orders in sequence. Replay is useful for checking whether entries, exits, stop behavior, and position changes match the rule logic.

Replay visualizes the historical simulation. It does not turn a backtest into live or paper execution and does not guarantee that a broker would have filled an order at the same time or price.

Common sources of overconfidence

  • Repeatedly changing rules until they fit one historical sample.
  • Judging a result with very few trades.
  • Ignoring slippage, fees, spread, liquidity, or broker restrictions.
  • Comparing runs with different dates, bar sizes, or capital.
  • Assuming an alternative-data publication timestamp was available earlier.
  • Treating simulated protective orders as guaranteed fills.

Comparing two runs

Change one major variable at a time and keep assets, dates, capital, bar size, and fee assumptions constant. Label each version with the change. If both the rules and the sample period change, a better result does not isolate a strategy improvement.

Compare the entire equity path and trade distribution, not only the final value. A revision can raise return by accepting a much deeper drawdown, concentrating exposure, or depending on fewer trades.

Trade-log review

Sample individual winners, losers, long holds, short holds, and trades around large market moves. Check that each entry and exit matches the rule and that sizing changes behave as intended. Unexpected duplicate or overlapping orders often reveal a rule-combination or position-state assumption.

Round trips and raw orders are not always the same count. A position can be built or reduced through several orders. Use the trade log’s grouping and timestamps when reconciling summary statistics.

Data and execution assumptions

Historical bars can be adjusted, incomplete, or provider-limited. A bar-based engine also needs an assumption about what can happen within a candle. Stops, limits, and multiple conditions that touch within the same bar can be especially sensitive to ordering assumptions.

Backtests cannot fully reproduce spread, slippage, market impact, queue position, partial fills, broker rejection, borrow availability, halts, or all fees. The gap grows for illiquid instruments, large sizes, and fast strategies.

Robustness questions

  • Does the result survive a nearby parameter choice, or only one optimized value?
  • Does it work across more than one market regime?
  • Is performance spread across trades and time?
  • What happens with less favorable entry and exit assumptions?
  • Are the required assets and data available throughout the sample?
  • Could publication delays or revisions create look-ahead bias?
  • Is the intended live broker mode compatible with the tested behavior?

From backtest to paper

Saving preserves the tested strategy record. A paper deployment begins a new ongoing simulation; it does not continue the historical ledger. Record the transition date and compare future paper behavior with the expectations formed from the test.

If paper results diverge, investigate market regime, incoming data, signal frequency, simulated fill behavior, and whether the deployed version exactly matches the tested one before concluding that either result is wrong.