Documentation
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
OutcomeMaximum drawdown
DownsideSharpe, Sortino, and Calmar
Risk adjustedTrades and win rate
SampleThe 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.
Backtests run by the assistant
When you ask the assistant to backtest, it runs the strategy on Astral's backtest engine and reports that run. Each result lists the backtest ID, date range, bar size, assets, starting capital, and commission and slippage it actually used.
Settings carry over. A strategy's first assistant run starts with $100,000 and no commission or slippage unless you ask for other values. After that, each new run keeps the capital, costs and dates the strategy last ran with; only the settings you ask to change are replaced. For example, after a run with $100 capital and 2 bps commission, asking for a different date range keeps $100 and 2 bps.
The assistant can read the individual trades of its recent runs: entry and exit times and prices, profit or loss, and why each position closed, such as a stop loss, take profit, trailing stop, or the exit rule. It can read the last five runs in the conversation and the strategy's saved latest backtest. For an older run, ask it to run the backtest again.
To compare variants or periods, such as different parameters or a training and a validation range, the assistant runs each one as its own backtest and reports each run's settings and results. Results come only from runs and calculations it actually performed. If part of a request cannot be run, for example short selling or an unavailable indicator, it says so instead of estimating a result. A calculation it makes from price data is labeled as custom analysis, not an Astral backtest.
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.
Forex and metals price checks
Forex and metals bars that move unusually far (a range, open-to-close move or gap of 5% or more) are checked against the data provider's own bid/ask quotes before the backtest runs. Most such bars match their quotes and are used unchanged, including genuine fast moves with wide spreads.
When the provider's bar is not backed by its quotes, for example a stray print before the Sunday reopen or a single quote far from every quote around it, Astral rebuilds that bar from the quotes and the backtest uses the rebuilt prices. The result shows a note above the metrics, also listed under Backtest details, such as 1 bar rebuilt from quotes: XAUUSD 2025-11-23 (1d) low 1964.99 → 4030.91. A rebuilt bar does not make the run unreliable; it records which prices differ from the provider's bar.
A backtest stops only when the quotes cannot establish a bar's price: the provider has no usable quotes for it, its quotes were too unreliable for most of the bar, or the provider could not be reached. The message names the symbol, bar size and bar time, for example XAUUSD price history could not be verified for the 1h bar at 2025-11-23 23:00 UTC. Choose a date range that excludes that bar. If the message says to try again shortly, the provider was unavailable and the same run can be retried. Changing fees, slippage or other cost settings does not affect this check.
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.