Argix Labs
Documentation

Testing

Backtesting

Test your strategies against historical data before you run them anywhere.

Backtesting limitations

Backtesting results are hypothetical and subject to material limitations including survivorship bias, look-ahead bias, and execution assumptions. A profitable backtest does NOT guarantee profitable live trading. See the Risk Disclosure for details.

How backtesting works

The backtesting engine simulates your bot’s logic against historical market data:

  1. Select a date range, asset(s) and a data provider (Yahoo Finance unless you choose another)
  2. The engine replays market data chronologically
  3. Your bot’s signals, filters, and rules are evaluated at each bar
  4. Simulated orders are filled at historical prices
  5. Performance metrics are calculated

Performance metrics

MetricDescription
Total ReturnNet profit/loss as a percentage
Sharpe RatioRisk-adjusted return
Max DrawdownLargest peak-to-trough decline
Win RatePercentage of winning trades
Trade CountTotal number of trades executed

Known limitations

  • Simple fills: Trades fill at the bar’s price, adjusted only by the slippage and commission you set. Real spreads and slippage vary.
  • No market impact: Your orders don’t affect the simulated market.
  • Perfect fills: All orders fill completely. In live markets, partial fills and rejections occur.
  • Data quality: Results depend on the quality and completeness of historical data.

Paper trading first

When you run an exported bot, start it on a paper or demo account. Paper trading is a closer approximation of live conditions than a backtest, though it still differs from real market execution.