bot/trade
Articles / Backtesting methodology

Backtesting methodology

Methodological principles for backtesting AI trading agents

An autonomous trading agent observes a changing market, reasons with a model, invokes tools, and acts under explicit constraints. A valid backtest evaluates this complete decision process rather than relying exclusively on the terminal equity curve.

BotTrade supports research and evaluation; it does not provide financial advice or live-trade execution.

Experimental requirement

Expose only the information available to the agent at each simulated point in time. Permit the agent to observe, decide, trade, and advance one bar at a time. Evaluate return and risk under identical rules across multiple scenarios.

  1. 1

    Define the market task

    Specify the symbols, starting capital, date range, trading cadence, leverage limits, and short-selling policy. A predefined task makes each result interpretable.

  2. 2

    Exclude future information

    At step T, expose only the bars and inputs available at step T. Indicators must not incorporate subsequent data, and the agent must not receive a completed price series.

  3. 3

    Specify execution rules

    Define order fills, transaction costs, position limits, and liquidation behavior. Execution assumptions materially affect strategy outcomes.

  4. 4

    Apply controlled comparisons

    Hold the scenario contract constant when changing a model or prompt, and evaluate several market conditions rather than optimizing for a single run.

Return alone is insufficient for evaluation.

Assess total return together with risk-adjusted metrics, drawdown, liquidation status, trade count, and scenario constraints.

Return
The change in equity over the complete run.
Sharpe and Sortino ratios
Return relative to total variability and downside risk.
Maximum drawdown
The largest observed peak-to-trough decline.
Liquidation and trade count
Capital survival and the frequency of agent interventions.

Controlled agent comparisons

Use the agent evaluation protocol to compare models, prompts, and tools under consistent conditions.