Blog

What Is Overfitting in Trading Backtests? Signs and Fixes

Overfitting in trading backtests explained: what curve fitting is, why it makes past results look better than they are, how to spot it and how to reduce it.

Written by: WICKVIPER AI review: WICKVIPER AI · Claude, Gemini Published: Updated: 6 min read

Overfitting in a trading backtest means a rule has been tuned so closely to past prices that it describes the random noise of that history rather than a pattern that repeats, so strong backtest results often fade on new data. The quickest warning sign is a rule with many tuned settings that looks excellent on the past but has never been tried on data it did not see while it was being built.

What is overfitting in a trading backtest?

A backtest applies a trading rule to historical prices to see how it would have performed. Overfitting, also called curve fitting, happens when you keep adjusting the rule until the historical result looks good. Any price history contains a little repeatable behaviour, if there is any at all, and a great deal of randomness. An overfitted rule memorises the randomness.

Picture a rule built on a moving average and an RSI threshold. You try many moving-average lengths, many thresholds, many stop distances and several trading sessions. Somewhere in that pile, one combination will look brilliant on the past purely by chance. You then present it as if you had found it in advance, when in fact you picked it after seeing the answer. The equity curve is smooth, the drawdown (the largest fall from a high point of the running total) is small, and the result tells you almost nothing about the future.

One term needs a plain explanation: R is the risk planned before the trade, measured from entry to stop-loss. A result of +1.00 R means a gain equal to the planned risk, and -1.00 R means the planned risk was lost. Measuring a backtest in R instead of currency makes rules easier to compare, but it does not protect you from overfitting. A curve fitted in R is still a fitted curve.

Why does overfitting happen?

Overfitting is rarely deliberate. It comes from ordinary habits that feel like improving a strategy:

  • Too many settings. Every extra parameter is another knob you can turn until the past looks right. The more knobs, the easier it is to fit noise.
  • Too little data. A short period, or a small number of trades, can be dominated by one lucky run. Good-looking numbers from a handful of trades are weak evidence.
  • Repeated testing. Each time you look at the result and tweak the rule, information about the answer leaks into the rule. This is often called data snooping.
  • Hidden failures. You remember and publish the version that worked. The many variations that failed are invisible to the reader, and often to you.
  • Ignoring costs. Real costs are the full round trip: spread, commission and slippage together, never the quoted spread alone. A rule with thin gains per trade can disappear once those costs are included.
  • Assuming perfect exits. A stop-loss is an order, not a price guarantee. In fast markets or across gaps the fill can be worse than the stop price, and a simple backtest often assumes this away.

None of this needs bad intent. It only needs a trader who wants the test to work.

How can you spot an overfitted backtest?

You do not need advanced statistics to see the warning signs. Check these before trusting any backtest, yours or someone else's:

  • The result is fragile. If a small change to one setting turns a profit into a loss, the profit probably sat on a lucky spike, not on a stable plateau of nearby settings.
  • It works on one instrument or one period only. A genuine behaviour usually shows at least some signs elsewhere. A rule that works on one chart in one year and nowhere else is suspicious.
  • Few trades stand behind impressive numbers. High percentages from a tiny count prove very little.
  • Exceptions were added after looking at the losers. Rules such as 'skip this day' or 'ignore that signal', added after seeing losses, are a classic form of fitting.
  • Out-of-sample results are far worse. If a rule was built on one stretch of data and performs much worse on a later stretch it never touched, the first result was mostly noise. Our glossary entry Out-of-sample test explains this check.
  • The rule was not written down first. If nobody can show what the rule was before the testing started, you cannot tell a discovery from a selection. See the glossary entry Pre-registration.
  • The curve is almost perfect. Real strategies have losing streaks and drawdowns. A backtest with none of them deserves more suspicion, not more trust.

How can you reduce overfitting?

You cannot remove the risk completely, but a clear process reduces it a lot:

  • Write the rule before you test it. State entry, stop, exit and costs in words first. Then test that rule, not a rule you adjusted along the way.
  • Keep the number of settings small. A rule you can explain in a few sentences is harder to overfit than one with many filters.
  • Split your data. Build the rule on one part of the history and keep a later part untouched. Look at the untouched part once, at the end. If you peek and then change the rule, that part is no longer untouched.
  • Test neighbouring settings. If the rule only works at one exact value and fails right next to it, do not trust it.
  • Include the full round-trip cost. Spread, commission and slippage all belong in the test, and so does the possibility that a stop fills worse than planned.
  • Count your attempts. Keep a note of how many variations you tried. The more you tried, the more sceptical you should be of the best one.
  • Collect fresh results. After the backtest, gather new results on data the rule has never seen and judge them in R, with losses shown. Expect them to be less impressive than the backtest.
  • Keep a journal. A written trading journal makes it harder to rewrite history in your memory.

For a longer walk-through see our articles How to Backtest a Trading Rule Without Bias and How Many Trades Do You Need to Judge a Strategy?, and the glossary entries Backtest and Expected value (expectancy).

What does our own results page show?

Our results are not a backtest, so they are not exposed to curve fitting in the same way, but they show well why slices of data mislead. Our closed setups from our MT5 account at our broker TegasFX are on our public results page, losses included; changes are listed in a public corrections log. See the data block below for the closed setups from 7 October to 13 November 2026.

As of 13 November 2026: 58 closed trades, 22 wins and 36 losses, a win rate of 37.9%. The total result is -5.11 R, an average of -0.09 R per closed trade. The longest losing streak is 9 trades in a row. These are the current totals, losses included, and they are not a success story. We do not call this an edge.

The split by instrument shows why slices deceive. As of 13 November 2026, XAUUSD has 33 closed trades with a total of -7.12 R and a win rate of 30.3%. XAGUSD has 3 closed trades with a total of +3.91 R, and US30 has 2 closed trades with a total of +2.51 R. Those last two samples are far too small to mean anything. If we showed only those slices, the results would look excellent. Choosing the best slice after the fact is exactly how overfitting works, and it is why we read the total, not the best part of it.

Regulators warn about the same pattern in marketing. The European Securities and Markets Authority has restricted CFDs to protect retail investors, and the UK Financial Conduct Authority runs its ScamSmart campaign to help people spot misleading investment claims. Treat any strategy, ours included, as a question to check against the full numbers, not as an answer.

Risk note: CFDs are leveraged and you can lose money quickly; backtested and past results do not predict future results, and nothing here is personal advice.

WICKVIPER data: All instruments

Closed, verified signals between 7 Oct 2026 and 13 Nov 2026. Source: our public ledger.

State described in this article: closed signals up to 13 Nov 2026, 21:33 UTC.

Total result
−5.11 R
Closed & verified
58
Win rate
37.9%
Average per trade
−0.09 R
Max drawdown
−15.99 R
WICKVIPER data: All instruments Cumulative result of 58 closed, verified signals: −5.11 R. -505 7 Oct 2026 13 Nov 2026 · −5.11 R

Now (updated automatically): 71 closed signals, −14.35 R in total.

See the ledger · How we verify

Questions

What is overfitting in trading?

Overfitting is tuning a trading rule until it fits past price data very closely, including its random noise. The rule then looks strong in the backtest but usually performs worse on new data.

How do I know if my backtest is overfitted?

Warning signs are a result that collapses when one setting changes slightly, good results on one instrument or period only, few trades behind impressive numbers, and much weaker results on data the rule never saw while it was being built.

Does using more indicators reduce overfitting?

No. More indicators and filters usually add settings, and every extra setting makes it easier to fit noise. A simple rule that you can explain in a few sentences is harder to overfit.

What is out-of-sample testing?

It means building a rule on one part of the historical data and checking it once on a later part that was kept untouched. If the untouched part looks much worse, the first result was probably mostly noise.

Do costs matter in a backtest?

Yes. The full round-trip cost is spread plus commission plus slippage, not the quoted spread alone, and a stop-loss can fill at a worse price than planned. Leaving these out makes a backtest look better than real trading would be.

Sources

  1. Investor corner — European Securities and Markets Authority
  2. ESMA agrees to prohibit binary options and restrict CFDs to protect retail investors — European Securities and Markets Authority
  3. ScamSmart — Financial Conduct Authority

Terms used here

  • Drawdown — The fall of an equity curve from its previous peak. Maximum drawdown is the largest such fall over a period, measured in our ledger in R.
  • Spread — The difference between the ask (buy) price and the bid (sell) price. Every round trip pays it once, before the market has moved at all.
  • Slippage — The difference between the price an order asked for and the price it got. It is largest when the market moves fast or liquidity is thin.
  • Stop-loss — An order that closes the position once price reaches a chosen level; slippage or a gap can make the loss larger. The distance from entry to the stop-loss defines 1 R.
  • Backtest — A test of fixed trading rules on historical data, as if they had been traded at the time. It is only as honest as its data and costs.
  • Out-of-sample test — A test on data that was not used to build or tune a strategy. It is the closest a historical test gets to new trades.
  • Pre-registration — Writing down a test's hypothesis, data, costs, test windows and pass threshold before any result is computed, so a failure counts as a failure.
  • Win rate — The share of trades that end in profit. On its own it says little: a 40% win rate can make money and a 70% one can lose it.

Written and reviewed by AI agents (Claude and Gemini models) under rules set by the owner; no person reviews each text. Last AI review: 15 Nov 2026. Sources are listed at the end of the article.

Read next