What is Backtesting?

Updated November 28, 2026

Backtesting is checking how a strategy would have done on past price data.

Want Your Money Working While You Sleep?

Get our free guide to letting AI trade for you, 5 minutes a day.


No spam. Unsubscribe anytime.

You run your rules on old charts and see what would have happened. It's like a test drive with history.

It helps you spot bad ideas fast before risking money.

The danger is overfitting, where a strategy is tuned to look perfect on old data but fails live. Past results never promise future ones.

In practice, you choose a strategy or bot, pick a market and a date range, set your starting balance, and let software replay old prices through the rules. MetaTrader's Strategy Tester does this for expert advisors. You then read the report, which lists net result, number of trades, win rate, profit factor and drawdown. A useful test covers several years, so it includes trends, quiet periods and sudden shocks.

Here is a worked example. You test a strategy on $10,000 over three years. The report shows 300 trades, 45% winners, a $3,000 net result and a 22% max drawdown, which is $2,200 at its worst. That is about 100 trades a year. Dropping the lot size by half would cut both the result and the drawdown roughly in half, so you can also learn what size suits your account.

A common beginner mistake is running a test, tweaking settings until the line looks perfect, then assuming it will continue. That is called overfitting. Low quality price data and unrealistic spread settings can also flatter the numbers. Testing with realistic costs and keeping back a stretch of data the rules never saw during tuning gives a fairer read. Past results never promise what happens next.

Backtesting is the first filter in a longer process. Forward testing comes next, often on a demo account, to see how the rules behave in current markets. A live account with small sizes follows that. Max drawdown is one of the most useful figures in any test. Algorithmic trading relies on this cycle, and comparing all three stages shows whether a test result was realistic.

Example

You test a gold bot on the last three years and see where it won, lost and how deep drawdowns went.

Primary Sources For This TopicWe check facts on this topic against these primary sources. See how we research.

Questions people ask

Can I backtest on MetaTrader?

Yes, it has a built in Strategy Tester for EAs.

Why do backtests look better than live trading?

Real spreads, slippage and changing markets usually make live results worse.

How much history should a backtest cover?

More is generally better, as long as the data is good. Several years with at least a few hundred trades will tell you far more than a few months.

What does modeling quality mean?

It rates how closely the tester's price data matches real ticks. On MetaTrader, tests on real tick data usually give more realistic results, especially for fast strategies.

Work out your own number with the quit your job calculator, or take the passive income quiz.

All guides · Answers · Glossary · Compare · Web stories · Wallpapers · Privacy · Terms