Backtesting Overview
Test your trading strategies against historical data before risking real capital.
What is Backtesting?
Backtesting allows you to:
- Validate Strategy Logic - Ensure your strategy behaves as expected
- Evaluate Performance - See historical returns, win rates, and drawdowns
- Optimize Parameters - Fine-tune settings for better results
- Build Confidence - Understand how your strategy performs in different market conditions
Testing Modes
TradeStaq offers two backtesting modes:
| Feature | Quick Test | Full Backtest |
|---|---|---|
| Duration | Fixed 7-day window | Custom date range |
| Save Required | No | Yes (strategy must be saved) |
| Metrics | Basic (Return, Win Rate, Trades, Drawdown, PF) | Full suite including advanced ratios |
| Chart | Trade markers on candlestick | Full equity curve + drawdown |
| Access | AI Builder editor panel | Backtests page |
| Speed | Instant (seconds) | Minutes (depending on data range) |
| Results Stored | In-memory only | Saved with versioning |
Quick Test
Available directly from the AI Strategy Builder editor. Select an exchange, symbol, and timeframe — the engine runs a 7-day instant backtest and returns results in seconds. No strategy save required. Ideal for rapid iteration during strategy development.
Full Backtest
Run from the Backtests page with full configuration options: custom date range, detailed metrics, equity curve visualization, trade list export, and result comparison. Requires saving your strategy first. Auto-versions strategy code so you can track changes over time.
How It Works
┌─────────────────────────────────────────────────────────────┐
│ BACKTESTING FLOW │
│ │
│ ┌──────────┐ ┌──────────────┐ ┌─────────────────┐ │
│ │ Strategy │───▶│ Historical │───▶│ Simulated │ │
│ │ Config │ │ Data │ │ Execution │ │
│ └──────────┘ └──────────────┘ └────────┬────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Results & │ │
│ │ Metrics │ │
│ └─────────────────┘ │
└─────────────────────────────────────────────────────────────┘
The Process
- Select Strategy - Choose a TradeStaq strategy to test
- Configure Parameters - Set trading pair, timeframe, date range
- Run Simulation - Strategy executes against historical candles
- Analyze Results - Review performance metrics and equity curve
Key Metrics
| Metric | Description | Good Value |
|---|---|---|
| Total Return | Overall profit/loss percentage | Positive |
| Win Rate | Percentage of profitable trades | > 50% |
| Profit Factor | Gross profit / Gross loss | > 1.5 |
| Max Drawdown | Largest peak-to-trough decline | < 20% |
| Sharpe Ratio | Risk-adjusted returns | > 1.0 |
| Sortino Ratio | Downside risk-adjusted returns | > 1.5 |
| Total Trades | Number of completed trades | Varies |
Subscription Requirements
| Feature | Free | Pro | Trader | Whale |
|---|---|---|---|---|
| Run Backtests | - | ✓ | ✓ | ✓ |
| Quick Test (AI Builder) | - | ✓ | ✓ | ✓ |
| Advanced Metrics | - | - | ✓ | ✓ |
| Multi-Timeframe | - | - | ✓ | ✓ |
| CSV/PDF Export | - | - | ✓ | ✓ |
| Public Sharing | - | - | - | ✓ |
| Parameter Optimization | - | - | - | ✓ |
| Backtest Comparison | - | - | - | ✓ |
Note: For live tier values, see the Plans Comparison page.
AI Builder Integration
The AI Strategy Builder includes a built-in Quick Test feature for rapid iteration. Describe your strategy idea, let the AI generate code, then instantly test it — all within the same interface. See AI Builder Testing for details.
Important Limitations
Note: Past performance does not guarantee future results. Backtesting has inherent limitations.
What Backtesting Cannot Simulate
| Factor | Real Trading | Backtesting |
|---|---|---|
| Slippage | Price moves between signal and execution | Assumes instant fill at signal price |
| Liquidity | Large orders may not fill completely | Assumes unlimited liquidity |
| Market Impact | Your orders affect the market | No market impact |
| Latency | Network delays exist | Instant execution |
| Exchange Issues | Downtime, rate limits | Perfect availability |
Best Practices
- Don't Over-Optimize - Avoid curve-fitting to historical data
- Use Out-of-Sample Testing - Test on data not used for optimization
- Consider Transaction Costs - Factor in fees and spread
- Test Multiple Periods - Verify across different market conditions
- Start Small Live - Paper trade before going live
Backtest States
| Status | Description |
|---|---|
| Pending | Queued for execution |
| Running | Currently processing historical data |
| Completed | Finished successfully with results |
| Failed | Error during execution |
| Cancelled | Manually stopped by user |
Next Steps
- Running a Backtest - Step-by-step guide
- Interpreting Results - Understanding metrics
- Best Practices - Optimization tips
- AI Builder Testing - Quick Test from AI Builder
Related Guides
- Trading Bots — deploy strategies after backtesting
- Available Strategies — browse strategies to backtest
- AI Strategy Builder — create custom strategies with AI
- Connect an Exchange — set up for live trading after paper testing