Strategy testingStrategy backtesting: fees, drawdown and validation
What a backtest measures, which costs to include and why an attractive equity curve is not enough.
A practical experiment plan for limiting repeated optimization and preserving an independent final test.

To check a backtest for overfitting, reserve later data before you start choosing parameters, keep a record of every variant, and freeze the selection procedure before opening the final test. An out-of-sample period only remains independent while its results do not influence your decisions. Looking at it after every adjustment gradually turns it into another development set.
You cannot prove that a strategy will work by finding one successful split. The purpose is narrower: make it harder to mistake a pattern selected from historical noise for a repeatable trading rule.
Start with a hypothesis and a small parameter budget. For example: “This rule attempts to follow sustained moves; I will compare three moving-average lengths while keeping exits and sizing fixed.” That is easier to audit than an open-ended search for whichever settings produce the highest return.
Count the alternatives honestly. Four entry thresholds, five stop distances and three time filters produce 4 × 5 × 3 = 60 combinations. If you later change the market or reject an inconvenient month, those decisions also belong in the research record. The final winner is the product of that whole search, not one isolated test.
An illustrative 30-month dataset could allocate 18 months to development, six to validation and six to a final holdout: 60%, 20% and 20%. These percentages are a planning example, not a universal rule. A slow strategy may produce too few observations in that period; a fast strategy may still have many strongly related trades.
Use development data to build the rule and validation data for the limited choices declared in advance. Open the final holdout once after freezing the specification. If its result prompts another change, label that period as observed and seek genuinely later data for a new final test.
Trades that overlap a boundary need special care. Decide which prices and outcomes belong to each stage, and leave a gap where necessary so that an outcome extending into the test period cannot guide training.
Imagine three fictional variants tested with the same cost model. A returns 18% during development and −4% during validation; B returns 12% and 3%; C returns 10% and 2%. Picking A only because 18% is largest discards evidence about its behavior outside development.
B is not automatically the right choice either. You need the predeclared objective, drawdown, number of trades and explanation for the rule. Suppose B's neighboring lengths produce 2.5%, 3% and 2.8% in validation. That is more stable locally than a lone 3% surrounded by large losses, but does not establish future profitability.
Keep the entire small grid. A smooth neighborhood is a diagnostic, not permission to enlarge the search until a pleasant plateau appears. After selection, record what result on the holdout would cause you to reject the hypothesis.
Overfitting and look-ahead bias are different problems. The first can occur while using only past information; the second gives a historical decision information unavailable at that moment. A good holdout does not repair a calculation that reads future prices.
Inspect indicator timestamps, higher-timeframe inputs and the timing of execution. A completed hourly value cannot guide a decision made halfway through that hour unless that value was already known. If a signal changes after a chart reload, examine repainting before comparing returns.
Tools such as Freqtrade's lookahead analysis can help diagnose specific implementations. A clean diagnostic does not rule out every data problem. Check missing observations, adjusted prices and the assets included in your dataset as well.
Use this checklist before the final test:
In a walk-forward experiment, repeat a predefined fitting procedure using only earlier data, then join the subsequent unseen test segments. Do not select the nicest segments afterward. See our historical testing guide for the surrounding workflow.
Clerix presents rules, Backtest, Paper and analytics as a connected process. Its testing engines and live execution are in development. Explore Clerix features with your frozen experiment plan, and confirm available capabilities rather than assuming an optimization or walk-forward engine is already included.
The ratio alone tells you little. Consider independent observations, market regimes, overlapping trades and how often you inspected the test. A calendar split is only one part of the design.
Yes, as new research. Keep the failed result, mark that period as observed and do not describe a revised test on it as independent confirmation.
No. It is limited evidence under a historical model. Operational checks, simulated forward observation and a separate assessment of real execution and risk remain necessary.