allorca

Backtesting

Running a trading rule over past prices to see how it would have done, as if it had been followed at the time.

Backtesting means taking a fixed rule, such as buying when a share's price climbs above its average over the last 50 days, and applying it to old price data to see what would have happened. The result is a record of trades that were never actually made. It matters because it is a cheap first check: it can show that an idea would not even have worked in the past. A rule tuned on one stretch of prices has been shaped to look good on that stretch, so a fairer test uses data the rule was not built from, such as later years held back until the rule is settled. The common misunderstanding is that a good backtest proves a rule works. It shows how the rule would have done in one particular past. Backtests can also flatter by leaving out trading costs, by using information that was not available at the time, or by testing only on companies that survived.

Example

Made-up numbers: a rule is tuned on five years of past prices and, on paper, turns $10,000 into $18,000. On the next five years, which played no part in building it, the same rule turns $10,000 into $10,500. The second figure is the fairer test. Both leave out trading costs, and neither is money anyone earned.

Related

This term appears in Allorca’s free lessons. Start learning.