تخطَّ إلى المحتوى الرئيسي

Back-Testing

Intermediate

الاختبار الخلفي

Also known as: Backtest, Historical Testing

Trading Strategies & Styles
Last updated

Definition reviewed before publishing

Our content team writes and reviews every definition before it is published, and revisits it when the way a term is used in the markets changes. The date shows the latest change to this term.

Last updated on 9 November 2026

Backtesting is the process of evaluating a trading strategy by applying its rules to historical price data to see how it would have performed had it been used in the past. It is used to measure potential profits and losses, win rate, maximum drawdown and other metrics before risking real money.

Quick summary

• Applying a strategy's rules to historical data. • Measures profit, win rate and maximum drawdown. • Prone to overfitting and multiple biases.

How it works

Backtesting starts by defining the strategy's rules precisely and unambiguously: entry conditions, exit conditions, stop loss, target and position size. These rules are then applied to historical data, either manually by reviewing charts trade by trade, or automatically using specialized software, tools built into trading platforms or code. Results include net profit, win rate, average win and loss, profit factor, maximum drawdown, number of trades and the Sharpe ratio. But backtesting has common pitfalls to watch for. First, overfitting: repeatedly adjusting parameters until they give perfect results on historical data, so the strategy is tailored to the past and fails in the future. Second, look-ahead bias: using information that was not available at the moment of decision. Third, survivorship bias: testing a strategy only on stocks that exist today while ignoring companies that went bankrupt or were delisted. Fourth, ignoring realistic costs such as spreads, commissions and slippage. To reduce these risks, it is advisable to split data into a development period and a separate test period, test the strategy across varied markets and periods, then try it in paper trading before trading live.

Example

A trader backtests a moving average crossover strategy on five years of currency pair data. The result: 180 trades, a 42% win rate, a profit factor of 1.35 and a maximum drawdown of 18%. They then test it on two years not used in development, and the profit factor falls to 1.1, so they realize live performance may be weaker.

Where you will see it

On trading platforms that offer strategy testing tools, in algorithmic trading software, and in strategy development methodologies.

Why it matters

It helps evaluate strategies before risking money, understand their characteristics and risks, and avoid false confidence in misleading results.

How it is calculated

Profit factor = total gains ÷ total losses. Maximum drawdown = (peak equity - subsequent lowest equity) ÷ peak equity × 100. Expectancy per trade = (win rate × average win) - (loss rate × average loss).

How it differs from similar terms

• Paper trading: applying the strategy to live data with virtual money, not historical data. • Forward testing: testing on later data not used in development. • Optimization: tuning strategy parameters, which can become overfitting if overdone.

Common mistakes

Overfitting parameters, ignoring costs and slippage, or testing on a short period and a single market. Test on out-of-sample data and include realistic costs.

Related terms