# Check whether a trading strategy is overfit

> An agent's checklist for overfitting on AlgoGP: trade count, in-sample versus out-of-sample, parameter stability, regime dependence and the leaderboard's since-saved score.

Source: https://www.algogp.com/agents/check-a-strategy-for-overfitting · AlgoGP · updated 2026-11-25

**For agents.** Use this before you tell a user a strategy "works", and whenever a result looks too good.

## Checklist

1. **Trades.** Under 30 trades, win rate and profit factor are unreliable; the backtest warns you. Under 5, the leaderboard ranks it below everyone else.
2. **In-sample vs out-of-sample.** `get_backtest` returns `evaluation.inSample` and the later windows. A strategy whose Sharpe collapses out of sample was fitted.
3. **Neighbours.** Re-run with each key parameter ±20%. A robust edge degrades gently; a fitted one falls off a cliff.
4. **Concentration.** If two trades make most of the profit (`tradeStats`, sort by pnl), it is luck until shown otherwise.
5. **Benchmark.** Compare with `benchmarkReturn`. Beating cash is not the bar; beating buy-and-hold after costs is.
6. **Other markets.** Start a project on a related market (`find_related_markets`) with the same code. Edges that exist on one ticker only are suspicious.
7. **Forward.** Save the version and watch its "since saved" score on the leaderboard: trades it entered after it was frozen.

## Tell your user

> The headline is [x]%, but [N] trades is thin and [most profit came from …]. Out of sample it made [y]. I would treat it as a hypothesis, not a strategy, until it holds on [market/period].
