Independent market intelligence
Research over noise · Risk before return
FOREX RESEARCH · STRATEGY SELECTION AND VALIDATION

Backtest overfitting: hidden trials, reused holdouts and honest validation

A strong backtest describes one result. To judge its evidence, reconstruct the search that produced it, the information available at each decision and the tests that were genuinely left untouched.

About 22 minutes16 languages

In simple terms

Backtest overfitting happens when the research process learns the peculiarities of old data too closely. The chosen rule may describe that history well while carrying little useful information into a new period.

Trying different settings is normal research. The problem is presenting the best result as though it came from one untouched experiment, or changing the rule after seeing data still called independent validation.

Ask for the experiment log, the selection rule, a reliable timeline and a record of what happened after the rule was frozen. A disappointing result can reveal a weakness; it does not by itself identify whether the cause was fitting, costs, a changed market or a coding error.

What this audit can establish

This guide examines the selection process behind Forex and crypto backtests. All numerical ledgers are invented teaching examples, not observed trades or evidence for a trading system. R is a fixed unit of planned price risk before costs. The probability worksheet assumes independent, correctly calibrated tests with all null hypotheses true; it does not estimate PBO, DSR or future profitability.

In this article
01

Audit the search, not only its winner

A report showing the strongest parameter setting omits a crucial comparison: how many alternatives had a chance to look strong? The research process includes discarded indicators, markets, sessions, test dates and manual revisions. A final curve can be mathematically correct yet support a much weaker claim than its presentation suggests.

Begin with a precise claim: which rule was selected, using which information, for which market and deployment conditions? Distinguish errors that invalidate the historical calculation from selection choices that weaken its interpretation. A reproducible result is necessary for an audit, but reproducibility alone does not make the selection unbiased.

02

Count the choices that could change the answer

Suppose a search combines three lookback lengths, four stop settings, two sessions and two timeframes. That is 48 configurations before any manual changes. Choosing a favourable start date, dropping a difficult currency pair or changing the ranking metric after inspecting the report adds research choices even if the software records only one final optimisation run.

Keep a dated record of the hypothesis, rule version, data snapshot, parameters, score and reason for rejection. Identical reruns used to verify a calculation are not new independent experiments. Conversely, an unrecorded manual revision is still part of selection. Report the known search and missing history instead of inventing a precise trial count from the surviving file.

03

Separate observation, availability and execution times

For every feature, record when its value became available. A candle's closing value cannot support a fill earlier inside that candle. A later correction to an economic release is not the value available at its first publication. A timezone conversion must preserve the actual instant, including daylight-saving changes where relevant.

Trace a few decisions from raw input to order and fill. Include rejected and unfilled orders. For an EA, inspect the bar or tick used by each condition rather than trusting a chart annotation. Faster computation cannot repair a timeline that supplies tomorrow's information today, and accurate arithmetic cannot make a synthetic chart price executable.

04

Check what crosses the train–test boundary

A chronological split is not enough if a training label uses an outcome that becomes known inside the test period. For example, a position opened before the boundary may close after it. If that final profit is used to choose the model at the boundary, information from the test interval has entered training.

A boundary is about information availability

Available before selection

Training features and their outcomes must be known when the rule is chosen. Fit transformations only on permitted training data.

Outcome crosses the boundary

A pre-boundary trade may have a later exit. Its final result cannot inform a decision made before that exit was known.

Later evaluation

Apply the frozen rule using information available at each later decision. Keep execution and outcome timestamps separate.

Original information-flow diagram. It illustrates one leakage mechanism, not a universal gap length or a complete cross-validation algorithm.

Track the start and end of each label's information interval and remove inappropriate overlaps for the chosen evaluation design. A fixed gap may help but does not automatically handle variable holding periods. In TimeSeriesSplit, gap counts observations, not calendar days. Past history available for a test feature's lookback is not automatically leakage; estimating a transformation on the full future-containing dataset is a different problem.

05

Give development, validation and the final holdout different jobs

Use development data to build candidates and validation data to make choices allowed by the research protocol. Reserve a final later period for the frozen process. If its results cause a new filter, a different stop or a new asset selection, that period has become feedback for development; relabelling it out of sample does not restore independence.

Keep the decision trail visible

Explore

Record every meaningful variant and the data used to compare it, including rejected ideas.

Select and freeze

Write the selection rule, cost assumptions and version before opening the final evaluation.

Evaluate later

Publish the frozen choice's result. A better-looking alternative discovered here starts a new research cycle.

Original audit diagram. A later period can inform the next development cycle, but cannot remain independent evidence for decisions made from its results.

Opening the same unchanged report again does not create a fresh experiment. Repeatedly checking results and stopping when they look favourable is a separate selection issue. Record when the holdout was first accessed and what changed afterwards. Preplanned sequential testing needs its own statistical design; an informal promise to stop looking is not a correction.

06

A walk-forward schedule can also be fitted

Walk-forward evaluation repeatedly chooses a rule using an earlier window and applies it to a later window. Predefine the window lengths, permitted candidates, retraining schedule, ranking measure and treatment of positions spanning a boundary. Every simulated choice must use only information that was available then.

Searching many window schedules and publishing only the best combined result creates another selection layer. Report that search too. Stitch the eligible later-period returns on a consistent capital and timing basis; a simple average of fold Sharpe ratios is not the Sharpe ratio of the combined return series. Explain gaps, overlapping evaluation windows and any capital resets.

07

Follow a frozen choice into the next period

Our invented ledger contains five candidates with identical planned risk per trade and equal trade counts within each period. Development gross results rank A highest. Each candidate then has 60 hypothetical later trades with a round-trip cost of 0.10R per trade. Selection is by development net result, with equal development trade counts and costs, so A is frozen before later results are viewed.

Invented candidate ledger · fixed R, no compounding
CandidateDevelopment gross (R)Later gross (R)Later costs (R)Later net (R)
A60.008.006.002.00
B47.007.506.001.50
C43.0012.006.006.00
D30.005.006.00−1.00
E25.00−1.006.00−7.00

A earns only 2R later after the assumed costs, while C earns 6R. This demonstrates a possible ranking reversal, not evidence that C should have been selected. Choosing C now uses the evaluation to make a new choice. One invented split cannot estimate PBO or establish that any candidate has an edge.

08

Measure how much cost the apparent edge can absorb

For A, later gross profit is 8R across 60 trades. At 0.10R per round trip, costs total 6R and net profit is 2R. Raising the allowance to 0.15R makes costs 9R and the result −1R. Gross performance and the selected rule have not changed; only the execution assumption has.

A's invented later period under three cost assumptions
Round-trip cost per trade (R)Total cost (R)Net result (R)
0.000.008.00
0.106.002.00
0.159.00−1.00

Break-even average cost is gross R divided by trade count: about 0.1333R per trade here. This is an arithmetic threshold, not a forecast of available liquidity. Use costs that match the instrument, size, holding time and order type. Account for spread already embedded in Bid/Ask fills before subtracting anything again; include relevant commission, slippage, financing or funding, and failed or partial fills where the model requires them.

09

Understand what repeated significance tests can manufacture

Consider a separate mathematical experiment: all tested null hypotheses are true, tests are independent and each has a correctly calibrated false-rejection probability α. The chance of at least one false rejection across N tests is 1 − (1 − α)^N. With α = 5% and N = 20, it is 64.15%, even though the individual test uses 5%.

1 − (1 − α)^N

Independent true-null tests · individual α fixed at 5%
Number of tests (N)Chance of at least one false rejection
15.00%
1040.13%
2064.15%
5092.31%
10099.41%

This is a familywise error probability under stated assumptions. It is not the probability that a selected strategy is overfit, the proportion of false discoveries among winners, or the chance of losing the next trade. An ordinary profitable backtest is not automatically a calibrated significance test. Counting variants does not give them an α of 5% without a valid statistical procedure.

10

Explore the assumptions, not a strategy's success odds

Change the number of independent tests and their individual false-rejection level below. The expected number of false rejections is N × α; this is a count averaged over repeated experiments, not a percentage of strategies. At the initial settings it equals 1, while the probability of at least one is 64.15%.

Independent-test teaching worksheet

20
5.00
Chance of at least one false rejection (%)
64.15
Expected number of false rejections
1.00
All null hypotheses are assumed true and every test is assumed independent and correctly calibrated. This is not a PBO, DSR or trading-profitability calculator. The two results answer different questions; one is a probability and the other an expected count.

The worksheet contains no trade returns and cannot assess an EA or a coin strategy. It cannot infer independence or calibrate a test from a performance chart. Its purpose is to make the selection problem visible while keeping its limited mathematical question separate from the much harder evaluation of a real research process.

11

Similar parameter settings are not independent tests

Changing a moving-average length by one bar often leaves most trades unchanged. Correlated variants do not satisfy the independent-test illustration. In the extreme case of exactly identical tests, repeating the same decision a hundred times still has the original false-rejection probability, rather than the independent-test value for a hundred tests.

Dependence does not excuse hiding the search. Preserve the full set and its return relationships for a suitable statistical analysis. Do not replace the actual trial count with a convenient effective count chosen to improve a score. The worksheet offers no correlation slider because a single guessed correlation is not enough to describe an arbitrary family of trading rules.

12

Keep Sharpe, DSR and PBO distinct

Sharpe compares average excess return with return variability for a specified series and frequency. Serial dependence, tails, the chosen benchmark and annualisation assumptions affect its interpretation. A high reported Sharpe is not the chance of a winning trade. No universal Sharpe, profit factor or minimum trade count certifies that a strategy will work.

The Deflated Sharpe Ratio addresses performance inflation from selection among trials and non-normal returns. PBO examines a different event: an in-sample winner ranking below the out-of-sample median under a defined selection-and-evaluation framework. Both require more information and assumptions than a screenshot supplies. Neither is computed by the independent-test formula above, and neither guarantees future profits.

13

Challenge a neighbourhood, then disclose that challenge

Compare nearby parameters, different cost assumptions and predeclared periods. A narrow spike surrounded by poor results warrants investigation; a broad stable region can be more informative about sensitivity. Neither pattern proves an economic edge, and a stable region found only after extensive searching is still a selected result.

Treat tests inspired by an attractive chart as new research choices. Keep their results, including failures. Specify whether changes alter only a diagnostic calculation or the deployable rule itself. Removing an unusually profitable trade can reveal concentration, but editing the historical sample until a preferred conclusion appears is another form of selection.

14

Look inside the equity curve, including open positions

Closed-trade balance can rise while open-position equity falls sharply. In our invented marks, balance moves from 10,000 to 10,100, then stays there while a position has a floating loss of 1,800. Equity falls to 8,300. Later the position closes and balance rises to 10,150. The rising sequence of closed balances hides an observed equity drawdown of 17.82% from 10,100.

Invented account marks · cash units, no cash flows
ObservationBalanceFloating P/LEquity
Initial mark10,000010,000
After an earlier close10,100010,100
While the next position is open10,100−1,8008,300
After that position closes10,150010,150

These are selected teaching marks with no deposits or withdrawals; the true intraperiod minimum could be lower. The example does not model a broker's margin liquidation. Request equity at a suitable observation frequency, exposure, leverage and open losses. A closed-trade list alone cannot reconstruct the path of floating losses or prove that an account could have survived it.

15

Use forward observation to audit the frozen implementation

Record signals, intended orders, submissions, fills, cancellations and costs after the code is frozen. Compare the same versions, symbols, hours and position sizes with the simulation. Paper execution can test timing and rule implementation, but does not establish the fills, capacity or financing that a live account would receive.

A live monitor adds observed evidence, not independence for a rule repeatedly changed in response to that monitor. Keep version changes and the full account period visible. Reconcile deposits, withdrawals and open positions before comparing returns. A short favourable interval cannot repair hidden historical trials, and a different broker feed can change both signals and execution.

16

Publish enough to reproduce the decision

Build an audit packet that makes the selected rule and the rejected alternatives inspectable. Separate what was specified before evaluation from what was learned afterwards. When history is missing, say which claims cannot be checked. A weaker but traceable conclusion is more useful than a precise-looking score without its inputs.

  • Research history: hypothesis, meaningful variants, rejected results, ranking metric and known gaps in the search log.
  • Data and timing: source snapshot, asset universe, missing records, timezone, information-availability times and outcome intervals.
  • Evaluation design: development, validation and holdout roles; first-access dates; retraining schedule and boundary rules.
  • Implementation: code or reproducible rules, version identifier, order logic, permissions and actual deployment settings.
  • Economics and risk: cost accounting, sensitivity range, equity drawdown, exposure, position sizing and a comparable benchmark.
  • Decision: frozen choice, later results, reasons to reject or limit the claim, and what genuinely new evidence is needed.

Do not deploy merely because a report passes a checklist. If realistic costs erase the edge, later data contradict the claim or the research history cannot be reconstructed, record that limitation. Further development is allowed; presenting the same feedback as untouched confirmation is not. The outcome of a good audit may be a narrower claim or a decision to stop.

Questions worth resolving

Does 64.15% mean my strategy is overfit?

No. It is the chance of at least one false rejection in the worksheet's independent, true-null, calibrated-test experiment. A real strategy's PBO or future performance cannot be inferred from that number.

Do more trades automatically cure overfitting?

No. Additional relevant observations can improve evidence, but correlated trades, repeated searching, changing regimes and execution assumptions still matter. There is no universal trade count that certifies an edge.

Can I keep improving the rule after seeing the holdout?

Yes, as a new development cycle. Record the revision and treat the viewed period as feedback. It can no longer be independent confirmation of a choice made from its results.

Does high-quality tick data prove a backtest is realistic?

No. Data quality does not validate information timing, selection, order logic, costs or available liquidity. State the simulator's rules and compare its output with suitable observed records.

Does a losing validation period prove overfitting?

No. Sampling variation, market changes, execution assumptions or implementation errors can also produce a loss. Investigate the cause and limit the claim rather than assigning one explanation from a single result.

Does parameter stability guarantee live profitability?

No. It is one sensitivity diagnostic. A stable region may still have been selected from many searches or rely on incorrect data, costs or risk assumptions.

How we prepared this guide

MyProfitFactor compared the original PBO and DSR research with primary documentation on time-series splitting, information leakage, simulator execution and account statistics. We created and independently checked the teaching ledgers and probability examples. The worksheet uses no market data and calculates neither PBO nor DSR. Full claim-to-source notes are retained with the research record.

Risk context

Historical simulations and hypothetical ledgers do not guarantee future returns. Forex and crypto trading can involve leverage, gaps, illiquidity and losses beyond a planned stop. This material explains how to challenge research evidence; it is not an endorsement of an EA, broker, exchange or trading strategy.

Primary references

Three main references keep the reader's source list compact. Additional primary documentation and the calculation audit are recorded in the research notes.

Created by the MyProfitFactor editorial team.

Copying or republication without attribution and an active link to the original material is prohibited. Usage policy.