Skip to content
Lexicon · Testing

What is backtesting?

Backtesting is testing a trading strategy's rules on historical market data to estimate how the strategy would have performed in the past.

Updated

(01) Explained

Backtesting, in plain terms.

A backtest takes rules that are precise enough to follow without judgement, such as when to enter, when to exit and how much risk to take, and applies them to past prices one bar at a time.

Every simulated trade is recorded, and the results are summarised in figures such as net return, max drawdown and the number of trades.

(02) Example

Backtesting a range breakout on 4h BTC/USDT

  1. Rule: enter when a 4h candle closes above the three-week range high with volume above 1.5x its 30-day average.
  2. Exit: a 3% trailing stop, or a close back inside the range.
  3. The backtest steps through every 4h candle in the test period, checks the entry rule, simulates each trade and applies the exit.
  4. The output is the full list of trades plus summary figures: net return, max drawdown and trade count.
(03) Why it matters

What to watch for.

  • Evidence before risk. A backtest shows how an idea behaved on history before any money depends on it.
  • Look-ahead bias. A backtest must only use information that was available at each moment. Using later data makes results look better than they could have been.
  • Overfitting. Rules tuned until they fit the past perfectly often fail on new data.
  • Costs and sample size. Check which costs such as fees are included, and whether there are enough trades for the result to mean something.
(04) In The Market Lexicon

Where it shows up in the product.

In The Market Lexicon, rules built without code are tested on full backtest history, and max drawdown is always shown next to net return.

How backtesting works in The Market Lexicon →

Test ideas like this on real market history.

Start free trialPro $50 · Elite $100 per month