Interpreting Backtest Results
Learn how to analyze backtest results and make informed decisions about your trading strategies.
Results Overview
When a backtest completes, you'll see:
- Summary Card - Key metrics at a glance
- Equity Curve - Visual performance over time with per-candle drawdown tracking
- Trade List - Individual trade details with entry/exit markers
- Statistics Panel - Comprehensive metrics
- Diagnostic Output - Strategy debug logs (if enabled)
Key Performance Metrics
Return Metrics
| Metric | Formula | Interpretation |
|---|---|---|
| Total Return | (Final - Initial) / Initial x 100 | Overall profit/loss % |
| Annualized Return | Total Return x (365 / Days) | Yearly equivalent |
| Monthly Return | Average return per month | Consistency measure |
Initial Balance: $10,000
Final Balance: $12,500
Total Return: ($12,500 - $10,000) / $10,000 = 25%
Risk Metrics
| Metric | Description | Target |
|---|---|---|
| Max Drawdown | Largest peak-to-trough decline | < 20% |
| Average Drawdown | Mean of all drawdowns | < 10% |
| Recovery Time | Time to recover from drawdown | Shorter is better |
The equity curve now includes per-candle drawdown tracking — at each candle, the current drawdown from peak equity is recorded, giving you a continuous view of underwater periods.
Trade Statistics
| Metric | Description | Good Value |
|---|---|---|
| Total Trades | Number of completed trades | Strategy-dependent |
| Win Rate | Winning trades / Total trades | > 50% |
| Average Win | Mean profit on winning trades | > Average Loss |
| Average Loss | Mean loss on losing trades | < Average Win |
| Largest Win | Best single trade | Reasonable |
| Largest Loss | Worst single trade | < 5% of capital |
Risk-Adjusted Returns
Profit Factor
Profit Factor = Gross Profit / Gross Loss
Example:
Gross Profit: $5,000
Gross Loss: $2,500
Profit Factor: $5,000 / $2,500 = 2.0
| Value | Interpretation |
|---|---|
| < 1.0 | Losing strategy |
| 1.0 - 1.5 | Marginal |
| 1.5 - 2.0 | Good |
| > 2.0 | Excellent |
Sharpe Ratio
Measures return per unit of total risk:
Sharpe = (Return - Risk-Free Rate) / Standard Deviation
| Value | Interpretation |
|---|---|
| < 0 | Worse than risk-free |
| 0 - 1.0 | Suboptimal |
| 1.0 - 2.0 | Good |
| > 2.0 | Excellent |
Sortino Ratio
Like Sharpe, but only penalizes downside volatility:
Sortino = (Return - Risk-Free Rate) / Downside Deviation
| Value | Interpretation |
|---|---|
| < 1.0 | Poor |
| 1.0 - 2.0 | Acceptable |
| 2.0 - 3.0 | Good |
| > 3.0 | Excellent |
Tip: Sortino is often more useful than Sharpe for trading strategies, as it doesn't penalize upside volatility.
Exit Reason Codes
Each trade in the results includes an exit reason. Understanding these helps diagnose strategy behavior:
| Code | Description | Meaning |
|---|---|---|
| SL | Stop Loss | Price hit the stop loss level |
| TP | Take Profit | Price hit the take profit target |
| trailing | Trailing Stop | Trailing stop was triggered |
| strategy_close | Strategy Close | Strategy signaled to close the position |
| dca | DCA Entry | Dollar-cost averaging added to position |
| flip | Position Flip | Strategy flipped from long to short or vice versa |
| end_of_test | End of Test | Position was open when backtest period ended |
| partial | Partial Close | Strategy closed part of the position |
DCA Trade Handling
When a strategy uses Dollar-Cost Averaging (DCA), trades are handled specially:
- DCA entries appear as separate trade records linked to the parent position
- Average entry price is recalculated after each DCA entry
- Position size accumulates across DCA entries
- Final PnL is calculated against the weighted average entry price
- Exit reason on DCA entries shows
dca— the parent trade shows the actual exit reason
Diagnostic Output
Strategies can emit diagnostic output using td.log() or td.debug(). When enabled:
- Log messages appear in a collapsible panel below the trade list
- Each log entry includes the candle timestamp and message
- Useful for understanding why a strategy entered or exited a trade
- Enable via the "Show Diagnostics" toggle in backtest settings
Equity Curve Analysis
What to Look For
| Pattern | Meaning | Action |
|---|---|---|
| Steady Uptrend | Consistent profits | Good sign |
| Volatile Swings | Inconsistent performance | Review risk management |
| Flat Periods | No trades or break-even | Check entry criteria |
| Sharp Drops | Large losses | Investigate specific trades |
| Stair-Step Up | Winning streaks | Sustainable if frequent |
Red Flags
| Warning Sign | Possible Issue |
|---|---|
| Single large spike | One lucky trade skewing results |
| Steady decline | Fundamentally flawed strategy |
| Long flat periods | Strategy may be inactive |
| Recovery never happens | Max drawdown too severe |
Trade Analysis
Individual Trade Review
For each trade, examine:
| Field | Purpose |
|---|---|
| Entry Time | When position opened |
| Exit Time | When position closed |
| Entry Price | Opening price |
| Exit Price | Closing price |
| Size | Position size |
| PnL | Profit or loss |
| PnL % | Percentage return |
| Duration | How long held |
| Exit Reason | SL, TP, trailing, strategy close, etc. |
Identifying Patterns
Look for:
- Clusters of losses - What market conditions?
- Big winners - Can you replicate the setup?
- Quick exits - Are stops too tight?
- Long holds - Strategy holding losers?
- DCA chains - Are DCA entries improving average price effectively?
Comparing Backtests
Side-by-Side Comparison (Whale Tier)
The built-in comparison tool lets you overlay multiple backtest results. Compare equity curves, metrics, and trade distributions across different parameter sets or strategies.
| Metric | Backtest A | Backtest B | Better |
|---|---|---|---|
| Total Return | 45% | 38% | A |
| Max Drawdown | 25% | 12% | B |
| Win Rate | 52% | 61% | B |
| Profit Factor | 1.8 | 2.1 | B |
| Sortino | 1.5 | 2.3 | B |
What Matters Most?
Prioritize based on your goals:
| Goal | Key Metrics |
|---|---|
| Maximum Growth | Total Return, Monthly Return |
| Capital Preservation | Max Drawdown, Win Rate |
| Consistency | Sortino, Profit Factor |
| Scalability | Trade Count, Avg Trade Size |
Making Decisions
When to Use a Strategy
The backtest results suggest the strategy is viable when:
- Positive total return across multiple periods
- Max drawdown within your tolerance (typically < 20%)
- Win rate above 45% with favorable R:R
- Profit factor above 1.5
- Sortino ratio above 1.5
- Sufficient trade count for statistical significance (50+)
When to Reject a Strategy
Consider rejecting if:
- Total return is negative
- Max drawdown exceeds 30%
- Win rate below 40% without high R:R
- Profit factor below 1.2
- Results depend on a few outlier trades
- Performance varies wildly across periods
When to Optimize Further
The strategy shows promise but needs work when:
- Good return but high drawdown → Improve risk management
- High win rate but low return → Improve take profits
- Low win rate but positive → Check stop losses
- Inconsistent performance → Review entry criteria
Next Steps
- Best Practices - Avoid common pitfalls
- Trading Bots Overview - Deploy your strategy
- Risk Management - Protect your capital
- AI Builder Testing - Quick iteration with AI Builder