Backtesting Concepts

What is a Backtest?

Why traders simulate strategies on historical data, what backtesting proves, and what it doesn't.

What is a Backtest?

A backtest is a simulation. You take a trading strategy -- a set of rules for when to buy and when to sell -- and run it against historical price data to see how it would have performed. No real money is involved. The market data already happened, so the backtest replays your strategy over that recorded history, candle by candle, and tracks the results.

Think of it like testing a weather forecasting model against last year's data. The weather already happened -- your model cannot change it. You are just measuring whether your rules would have predicted rain on the right days. The data is fixed, and your strategy is an observer reacting to it.

Historical dataLive tradingTodayA backtest replays your strategy here

Why Backtest at All?

Every strategy sounds reasonable in the abstract. "Buy when RSI drops below 30, sell when it crosses above 70" seems logical -- but does it actually make money on the asset and timeframe you plan to trade? Backtesting gives you a concrete answer instead of a guess.

A backtest produces real numbers: total return, max drawdown, win rate, Sharpe ratio, and dozens of other metrics. These numbers let you compare strategies objectively rather than relying on intuition or cherry-picked examples.

Backtesting is not prediction
A backtest tells you what would have happened in the past. It does not tell you what will happen in the future. Markets change -- trending markets can turn sideways, calm markets can turn volatile -- and a strategy that worked perfectly on last year's data might struggle on next year's. The value of a backtest is in quantifying historical behavior -- not in guaranteeing future profits.

What a Backtest Proves

A well-run backtest can answer several concrete questions:

Did this strategy make or lose money historically?
The most basic question. Total return gives you the raw answer.
How much risk was involved?
Max drawdown shows the worst peak-to-trough decline. Volatility measures how bumpy the ride was.
Was the return worth the risk?
Risk-adjusted metrics like the Sharpe ratio and Calmar ratio put return and risk into a single number so you can compare strategies on equal footing.

What a Backtest Does Not Prove

There are important things a backtest cannot tell you, no matter how good the results look:

It does not guarantee future performance

Past results are just that -- past. Market conditions change. A strategy that captured a specific trend might not work when the market enters a different phase. A backtest describes what happened, not what will happen.

It does not capture every real-world cost

Backtests simulate spreads, commissions, and slippage based on the settings you configure, but real markets can behave differently. Liquidity dries up, spreads widen during volatility, and order fills are not always at the exact price you expect. The closer your cost settings match reality, the more useful the results.

It does not account for human behavior

In a backtest, every signal is followed mechanically. In real trading, fear and greed interfere. You might close a winning position early or hold a losing one too long. A backtest shows what happens when the rules are followed perfectly -- not what happens when a person follows them.

If backtests can't predict the future, why bother?
Because they give you historical data to base decisions on instead of guesswork. A strategy that earns or loses money across 5 years of historical data has a track record you can evaluate. Without backtesting, you are relying entirely on intuition.

Anatomy of a Backtest

Every backtest has the same basic ingredients:

An asset
The instrument you are testing on -- a stock, a forex pair, or a cryptocurrency.
A timeframe
The candle interval (1 minute, 1 hour, daily, etc.) and date range. These determine how much data the backtest runs over and how granular the signals are.
Entry and exit conditions
The rules that tell the strategy when to open and close positions. These are built from indicators, price comparisons, and logical operators. See Entry & Exit Conditions for a deeper look.
Position type (direction)
Whether the strategy goes long (profits when price rises), short (profits when price falls), or both.
Cost settings
Spreads, commissions, and slippage that simulate real trading costs.

The backtesting engine takes these inputs, steps through the historical data candle by candle, applies your rules, and produces an equity curve and a full set of performance metrics. For a closer look at what happens during that candle-by-candle process, see How the Simulation Works.

When Results Look Unusually Strong

Backtest results that show very high returns with very small drawdowns are worth examining closely. There are a few common reasons results can appear stronger than they are:

Unrealistic cost settings
If spreads, commissions, or slippage are set too low, the backtest does not account for the costs that would reduce returns in live trading. Check the Transaction Cost Analysis card in your results to see how much costs are dragging down your returns.
Low trade count
A small number of trades makes results statistically unreliable. Five winning trades in a row can happen by chance.
Overfitting
A strategy with many parameters can be tuned to fit the specific data it was tested on. This is called curve fitting, and it produces results that look strong on the test data but do not generalize.

Where to Go Next

How the Simulation Works -- understand the candle-by-candle execution loop that powers every backtest.

Limitations & Pitfalls -- the biases and traps that make backtest results misleading if you are not careful.

Timeframes & Data -- how your choice of candle interval and date range shapes the results.

Entry & Exit Conditions -- how signals, crossovers, and logic operators define a strategy.

Your First Backtest -- a hands-on walkthrough if you have not run one yet.