# What is backtesting?

Canonical: https://bestaistocktools.com/glossary/backtesting
Updated: 2026-11-08
Site: bestaistocktools (https://bestaistocktools.com). General information, not financial advice.

## Definition

Backtesting is testing a trading or investing rule on historical market data to see how it would have performed had it been followed in the past.

## Backtesting, explained

A backtest applies a fixed set of rules, such as "buy when the 50-day moving average crosses above the 200-day", to past prices and records the hypothetical trades, returns, drawdowns and win rate. Some screeners and charting platforms include a backtesting module.

A sound backtest includes trading costs, uses only data that would have been available at the time, covers several market regimes and includes delisted stocks. Leaving any of these out tends to make results look better than they would have been.

Backtested results are hypothetical. When a vendor quotes impressive historical returns for its AI or strategy, check whether they come from a backtest or from picks that were recorded live and dated at the time.

## Example

A trader might backtest a rule that buys stocks hitting a 52-week high and sells after 20 trading days, then compare its 2010–2025 results against simply holding an S&P 500 index fund.

## Tools that use this

- [Finviz](https://bestaistocktools.com/tools/finviz.md): Stock screener and market maps; the paid Elite tier adds real-time data, advanced charts, alerts, backtesting and export.
- [TrendSpider](https://bestaistocktools.com/tools/trendspider.md): Charting and technical-analysis platform that automates trendline and pattern detection, market scanning, backtesting and trading bots.

## Related terms

- [Overfitting](https://bestaistocktools.com/glossary/overfitting.md): Overfitting is when a model or trading rule is tuned so closely to historical data that it captures noise instead of a lasting pattern, so it performs well in backtests but poorly on new data.
- [Survivorship bias](https://bestaistocktools.com/glossary/survivorship-bias.md): Survivorship bias is the error of judging results only from the stocks, funds or strategies that still exist, ignoring those that failed or disappeared, which makes past performance look better than it was.
- [Benchmark (S&P 500)](https://bestaistocktools.com/glossary/benchmark-sp500.md): A benchmark is a standard used to judge investment performance; for US stock tools it is usually the S&P 500, an index of about 500 large US companies weighted by market value.
- [Alpha](https://bestaistocktools.com/glossary/alpha.md): Alpha is the part of an investment's return above or below what its benchmark or risk level would predict, often used as shorthand for beating the market.

## Where this matters

- [Best AI stock screeners](https://bestaistocktools.com/best/ai-stock-screeners.md): Filter the market with AI scores and natural-language queries.
- [AI stock tools glossary](https://bestaistocktools.com/glossary): All 12 terms, A–Z.
