Our journal app is in pre-release. If you notice a problem, please contact us.

Home › Articles › Why a great backtest can fail live

Article

Why a great backtest can fail live

The backtest showed a clean, rising line, but live results did not keep up. If you have tested an EA (an automated trading program) or a strategy, this may have happened to you. One reason is overfitting, also called curve fitting. This article shows, with a chart and research, why trying many variations can make results look good by chance. It does not tell you which strategy or settings to use.

Published 13 Oct 2026By Kenji Okumura, Representative, Tiltnote (has traded forex)

In short

If you try many settings or rules and pick the one with the best past results, it can look good by chance even if it has no real advantage. This is called overfitting (curve fitting). The more variations you try, the more likely it is.

There are other reasons a backtest can fail live, such as trading costs like spreads, slippage and commissions that differ from the backtest (see counting your trading costs), and changes in how the market behaves. This article looks at one of them: overfitting.

What overfitting is

A backtest calculates what would have happened if you had traded a set of rules on past prices. If you keep changing the period, stop distance, indicator settings and so on, some versions will happen to fit the past prices very well.

Those settings may only fit the random quirks of that past period. If so, they may not do as well in another period or in live trading.

200 random rules applied to a random price path. The rule with the best result in the first half rises steadily there, but does not keep rising in the second half, which was not used to pick it.
A made-up example. The prices and all 200 rules are random (coin flips). The rule that ranked first in the first half (the thick blue line; the thin lines are some of the other rules) rose a lot there, but in the second half, which was not used to pick it, it did not keep rising and fell instead.

Every rule in the chart decides buy or sell by flipping a coin, so none has a real advantage. Even so, if you pick the best of 200, it looks like a "good rule" when you only look at the first half.

What research shows

A paper that studied backtest overfitting mathematically shows the following.[1]

These results use a simplified model of prices, and real markets may not follow those assumptions. Still, it is worth remembering that trying many variations and picking the best, by itself, pushes results to look better.

How you can check in MT5

The MT5 Strategy Tester has "optimization", which runs a strategy many times with different settings, and "forward testing", which runs it again on a different period. The MT5 help says forward testing helps you avoid fitting settings to certain parts of the historical data. In the "Forward" tester setting, you can use half, a third or a quarter of the period for the forward test, or set the forward start date yourself.[2] Other testing tools also let you check on a separate period; the names and steps differ.

Even if the forward period looks good, it is one check, not a promise of future results. If you adjust your settings after seeing the forward results and test again, over and over, you start fitting to the forward period too.

What you can do (you decide)

This article does not decide which strategy or settings to use. When you look at backtest results, logging these makes overfitting easier to spot:

The trading stats calculator turns a profit and loss list into win rate, average P&L and longest losing streak. The losing streak calculator shows how often losing streaks happen even when your win rate stays the same. For mistakes in measuring that can make a backtest look profitable, such as leaving out costs or guessing the order of prices inside a bar, see why a backtest can show an edge that isn’t there.

Sources

  1. Bailey, D. H., Borwein, J. M., López de Prado, M., & Zhu, Q. J. (2014). Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance. Notices of the American Mathematical Society, 61(5), 458. https://doi.org/10.1090/noti1105 (authors' copy: https://www.davidhbailey.com/dhbpapers/backtest-pseudo.pdf)
  2. MetaQuotes. Strategy Testing (MetaTrader 5 Help). https://www.metatrader5.com/en/terminal/help/algotrading/testing

Tools for this article

Log live results next to your backtest.

Tiltnote is a trading journal you can use free with manual entries. On every trade you can log your strategy name, how you felt, whether you kept your rules, and a note. Put the settings in the strategy name, and you can look back at live results and compare them with your backtest yourself.

Try Tiltnote free →Opens the Tiltnote web app. On the free plan, analysis and history show your most recent 14 days (older records are kept and unlock on the paid plan).

More articles

Risk-reward ratio and break-even win rateLosing streaks, in numbersWhat to write in a trading journalWhy a backtest can show an edge that isn't thereHow far can you trust your win rate?Confirmation bias in tradingArticles →

Feedback on this page

Anything missing, unclear, or a tool you would like? Tell us in any language.

Numbers you entered in a tool are not sent. Please do not include account numbers or passwords. Privacy details

This article is general information. It is not investment advice or a recommendation to make any trade.

Updated 20 Oct 2026 · Run by Kenji Okumura, Representative, Tiltnote · About this site