Testing
Backtesting
Test your strategies against historical data before deploying to live markets.
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:
- Select a date range and asset(s)
- The engine replays market data chronologically
- Your bot’s signals, filters, and rules are evaluated at each bar
- Simulated orders are filled at historical prices
- Performance metrics are calculated
Performance metrics
| Metric | Description |
|---|---|
| Total Return | Net profit/loss as a percentage |
| Sharpe Ratio | Risk-adjusted return |
| Max Drawdown | Largest peak-to-trough decline |
| Win Rate | Percentage of winning trades |
| Trade Count | Total number of trades executed |
Known limitations
- No slippage modeling: Backtests assume fills at the exact historical price.
- 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
Always deploy to paper trading after backtesting. Paper trading provides a closer approximation of live conditions, though it still differs from real market execution.