← Glossary Free resource

Backtesting and replay

Backtesting means testing a method on past data. Market replay is its manual form: the market is played back candle by candle, without showing what comes next, and you take your decisions as you would live. The difference between the two fits in one word, and that word decides how much the result is worth.

Key takeaways

  • The definition: backtesting tests a method on past data, replay tests it by hand, candle by candle.
  • What replay adds: not knowing what comes next. It is the only thing separating a test from a re-reading.
  • Its real value: accumulating cases quickly. Fifty occurrences of a setup in one evening instead of six months.
  • The figure to get out of it: the same statistics as your live trading, to compare the two populations.
  • What it does not simulate: derivatives. It replays candles, not an option chain.

1. What is Backtesting and replay?

Traders define backtesting as applying a method to past data to find out what it would have returned. The backtesting meaning most people have in mind is the automated one: a program sweeps the history and gives a great many figures very fast. Done by hand, it becomes replay: the market moves forward candle by candle and stops where you are.

The distinction that matters is not technical, it is cognitive. An automated test has no opinion, so it does not cheat, but it only tests what you managed to write down as rules. A replay tests what you actually do, hesitations included, on the strict condition that what comes next stays hidden. Re-reading a chart whose outcome you already know tests nothing at all: it confirms.

And what replay does not reconstruct has to be said. It replays candles, meaning a price through time. It rebuilds neither the order book, nor the premiums and implied volatility of an option chain, nor the real slippage of a large order. On those subjects, an honest replay says what it does not know rather than pretending.

2. The calculation formula

The basic formula

A useful test = a setup defined in advance × enough occurrences × the outcome hidden

The setup defined in advance is the condition most often missed. A setup that sharpens as the replay goes describes the trades you took, not a rule.

The number of occurrences is what replay buys you: it is compressed time, and it is its only real promise.

The hidden outcome is not negotiable. Scrolling a chart you have already seen produces flattering statistics describing no decision at all.

A worked example

  • One setup, defined in a sentence before starting.
  • Three months of history replayed in one evening.
  • 52 occurrences found, 52 decisions taken.
  • Replay win rate: 48%. Expectancy: +0.31R.
  • Live, same setup, 19 trades: +0.04R.

The setup holds in replay and does not hold live. The method is not what is at fault, the gap between the two populations is: 52 decisions taken calmly against 19 taken in session. That figure only appears if you compute the same statistics on both sides, and it points at execution work rather than strategy work.

3. What it is used for

Gathering fifty cases of a setup in one evening

It is the one promise replay keeps for certain, and it is enough to justify it. A setup appearing twice a week needs six months to give fifty live occurrences, and one evening in replay.

Below about thirty cases, no figure drawn from a test deserves changing anything. That floor is exactly what replay lets you reach before putting money at risk.

Measuring the gap between what you can do and what you do

Compute the same statistics on both sides, on the same setup. The gap between replay expectancy and live expectancy is a direct measure of what session conditions cost you, and it is a figure nothing else gives.

It also settles a question people otherwise ask themselves for years: should I change method, or learn to hold the one I have.

4. Why the generic calculation misleads

The first flaw is the chart you have already seen. Replaying a period you remember tests no decision, it confirms a memory. It is the most common flaw and the hardest to admit, because the result is excellent and it really does feel like work.

The second is the setup that sharpens along the way. Adding a condition after an occurrence that would have lost produces a rule cut from its own data, and it will never repeat. The rule is written first, in one sentence, and it does not move until the test ends.

The third is taking replay at its word. It knows neither the order book, nor slippage on a large order, nor an option chain. A setup whose profitability rests on a few ticks is precisely the one replay measures worst.

5. Advantages and limitations

Advantages

  1. It compresses time. Six months of occurrences fit into one evening, which is what makes a usable sample reachable.
  2. Being wrong costs nothing, so it allows testing ideas you would never commit money to.
  3. It produces statistics comparable to live trading, turning an impression into a measured gap.

Limitations

  1. It does not reproduce session conditions, and that is exactly what explains most gaps with live results.
  2. It replays candles, so it simulates neither the order book, nor real slippage, nor any derivative.
  3. It is very easy to cheat at without meaning to, and a cheated test looks exactly like a good one.

The classic mistake. Replaying a period you lived through. The result is excellent, the work looks serious, and nothing has been tested: you do not take a decision when you already know the outcome, you reconstruct it. An older period or an instrument you do not follow costs exactly the same time and returns a figure that means something.

6. Comparison with related indicators

IndicatorFormulaWhat it measuresWhen to use it
Replaydecisions taken by hand, outcome hiddenWhat you actually doTesting a discretionary method
Automated backtesta program sweeps the historyWhat your written rules returnTesting a fully coded method
Demo accountreal time, fake moneyExecution, at real speedGetting used to a platform
Live trade journalwhat actually happenedWhat you do with real moneyEverything else in this glossary

The differences that matter

  1. Replay and automated backtesting do not test the same thing. The second tests rules, and tests them perfectly. The first tests a trader, hesitations included. A discretionary method cannot be tested any other way, and a coded method has no reason to go through a manual replay.
  2. Replay and a demo account are not rivals, they serve at different moments. Replay is for accumulating cases fast, the demo is for getting used to a platform at real speed. Confusing the two means spending six months on demo for a sample one evening of replay would have given.
  3. Neither replaces the live journal. The gap between replay and live is precisely the information you are after: it only exists if both are measured with the same statistics.

7. How to improve it

1. Write the setup in one sentence before starting

One sentence, not a page, and it does not move until the test is over. A setup that sharpens along the way produces a rule cut from its own data, and it will never repeat in session.

2. Replay a period you did not live through

It is the only protection against confirmation. A chart you remember gives an excellent, empty test. An older period, or an instrument you do not follow, costs the same time and is worth far more.

3. Compute the same statistics on both sides

Win rate, expectancy and average R on the replay, then on the same setup live. It is not the replay figure that teaches you something, it is the gap between the two.

8. Frequently asked questions

What is backtesting in trading?

It is applying a method to past data to find out what it would have returned. Backtesting trading strategies this way says what a rule would have given, and nothing about what you would have done with it in session. Done by a program, it sweeps the history and gives many figures fast. Done by hand, it becomes replay: the market moves forward candle by candle and stops where you are.

What is the difference between backtesting and market replay?

An automated backtest tests written rules, perfectly and without opinion, but it only tests what you managed to write down. Market replay tests what you actually do, hesitations included, on the strict condition that the outcome stays hidden. A discretionary method cannot be tested any other way.

How many occurrences before concluding?

Thirty at the very least, and fifty is more comfortable. Below that, the gap you observe comes from the luck of the sample and no figure deserves changing a rule. That floor is exactly what replay lets you reach in one evening instead of six months.

How to backtest without fooling yourself?

Three rules are enough: write the setup in one sentence before starting and never touch it again, replay a period you did not live through, and compute the same statistics on the replay and on your live trading. The third is the one people skip, and it is the only one producing new information.

Can options or derivatives be replayed?

No, and it is a limit worth knowing before relying on it. A replay plays back candles, meaning a price through time. It rebuilds neither an option chain with its premiums and implied volatility, nor the order book, nor the real slippage of a large order.

9. In Tradoshi

The Backtesting screen replays history candle by candle without showing what comes next, with a simulated execution engine. Costs are set when the session opens, spread, slippage, commission and swap, and each order type has its rule: a market order fills at the candle close with spread and slippage, a limit order fills at the level or better with no slippage, a stop order takes the slippage because it consumes liquidity. Stepping back is possible, and it really erases what was done after the point you return to, on screen and in the database, so a session never keeps two versions of the same decision.

Trades taken in replay are analysed with the same statistics as your real trades, which is the whole point: the win rate, R and expectancy of a backtest session compare directly with those in your journal. A session's resume point, however, lives in memory: closing the tab loses it. The result itself is saved at every step.

10. In summary

  1. Backtesting tests a method on past data; replay tests it by hand, candle by candle, without showing what comes next.
  2. Its real value is compressing time: fifty occurrences of a setup in one evening instead of six months.
  3. The useful figure is not the replay's, it is the gap between replay and live on the same setup.

To go deeper on this: read the full guide. Every term is gathered in the glossary.

Popular guides

Free toolFree winrate calculatorGuidePnL meaning in tradingFree toolFutures contract calculator