BANGER
Product status: Banger’s public beta is paper-only. References to live execution are future-looking. Venue rules and legal claims can change; verify current primary sources for your jurisdiction.
2026-07-16 · 4 min read · reviewed 2026-10-14

Avoiding Overfitting in Strategy Backtests

Repeatedly choosing parameters after seeing their results can make a backtest look more persuasive than its evidence supports. A strong historical curve alone cannot establish future behavior. This guide offers checks for research integrity, rather than a test that guarantees an edge or predicts that every tuned strategy will fail.

What overfitting actually is

Overfitting describes a model or selection procedure capturing sample-specific patterns that do not generalize as intended. A poor later result can be consistent with that problem, but can also reflect changed data, costs, market conditions or an implementation error. Diagnose the difference rather than assigning an automatic cause.

Record every attempted variation, including discarded logic, parameter sets and dataset changes. The final selected result depends on that search history. Bailey and colleagues demonstrate how a search over random-walk data can produce an attractive in-sample variant with poor later performance; their experiment is not a universal threshold for every contract dataset.

The warning signs

These observations prompt investigation; none proves overfitting by itself:

There is no single number of variations at which every experiment becomes invalid. The search space, dependence between variants and sampling model matter. Preserve the full trial ledger rather than importing a simulated demonstration’s count as a rule for your own backtest.

Guardrail 1: out-of-sample testing

Separate development inputs from a later evaluation designed before its results are used for further choices. A test remains informative only under its actual access history. Calling data out of sample does not erase the fact that you previously viewed its outcomes.

Choose an evaluation window and event grouping suited to the hypothesis, then record the choice. There is no universal 20-to-30-percent split. Preserve related contracts and outcome-label timing so the same event’s later information does not leak into development. If a result prompts a change, record that change and the need for a new evaluation.

Walk-forward and other validation designs address different questions under their own assumptions. A time split alone does not prevent overlapping labels, revised external features or repeated researcher access. Do not assert that one method universally has a lower false-discovery rate than another.

Guardrail 2: parameter robustness

Inspect how the selected rule behaves under a predeclared range of neighboring inputs. A broad stable region can be useful evidence, but it is not proof of a signal. A discontinuity can arise from a real price grid, contract rule, size floor or constraint; investigate the mechanism before calling it noise.

Record sensitivity to fees, executable-price assumptions, coverage and timing. Resampling a trade sequence changes dependence unless the procedure explicitly preserves it. A Monte Carlo label alone does not make a simulated uncertainty estimate valid for correlated event outcomes.

Guardrail 3: trade-count and selection-bias sanity checks

There is no universal minimum of 30 trades that establishes statistical power. Effective evidence depends on independence, variability, effect size, event coverage and the chosen analysis. More rows from the same outcome need not supply more independent information. Report the observed sample and uncertainty rather than declaring it sufficient by count.

Bailey and López de Prado’s Deflated Sharpe Ratio addresses selection bias and non-normal returns under a specified statistical model. A trial count is important evidence, but is not by itself a completed correction or proof of edge. Do not apply an annualized Sharpe to sparse event P&L without stating its sampling and dependence assumptions.

Building the discipline into your workflow

Banger’s public beta supports paper research. A later observation window supplies later data, but not necessarily an untouched hypothesis, independent events or faithful execution. Version the strategy, select exact markets, follow the CLI account setup and preserve the mode and result assumptions. A supervised local run of your existing strategy.py can use:

pip install bangertrades
banger run strategy.py --paper

The packaged Banger 0.1.7 envelope uses cumulative-position, UTC-day loss, position-count, concentration and activity fields. Its loss admission does not flatten holdings or establish a worst-case loss ceiling. Forward-paper passive fills and fee rounding have documented simulation limits. Preserve failures, zero-order observations and unknown coverage; these checks improve interpretability without establishing live readiness or profitable trading.

Sources

Keep reading

Run your first strategy free

Paper-trade on Polymarket and Kalshi market data without venue keys.

Start free