For Business

Backtesting & Statistics

What Is Backtesting

Backtesting is taking a rule you have written down and running it over bars that have already happened, writing down every result, to learn what the rule would have done and nothing more. This paper shows you backtesting in five lines; the idea as a tape of old bars rewound and played with a rule; one deliberately plain example rule, buy at 10:00 and sell at 18:00, on the euro for the week of 24 August 2026 on real hourly bars; its result trade by trade, a loss of 56.7 pips; and the Bars tab on your platform, where the old bars already live.

Difficulty
Beginner
Reading time
5 min
Pages
8
Reviewed by
Saman Rahbar

This paper is locked

Read it in the browser and keep the PDF with Premium, or buy this one paper.

Backtesting in five lines

Backtesting is taking a rule you have written down and running it over bars that have already happened, to see what it would have done. It has four parts: the rule, the old bars, the costs of each trade, and the result written down trade by trade. It answers one question, what this rule would have done on those bars, and nothing more; it cannot promise the next bars, because the future is not in the file. The example in this paper is deliberately plain: buy the euro against the dollar at 10:00 on the feed's clock and sell at 18:00, every day of one week in August 2026. It lost 56.7 pips, where a pip is the fourth decimal place of the price, and that honest answer is the point of asking.

A tape of old bars, rewound

Picture a tape. Every bar since January is on it, and it does not change. A backtest rewinds the tape and plays the rule over it, reading the rule aloud at every bar, buy here, sell there, and writing down each result. The same tape can be played with a hundred different rules, which is what makes it useful and what makes it dangerous, because a rule can be bent until it fits one tape. What gets written down is what the rule would have done, not what you would have done watching the bars arrive live with money on them, and the two are not the same.

This paper is locked