Overfitting means building a rule that fits the quirks of the data you tested it on rather than anything that will repeat. In trading it is the most common reason a backtest looks excellent and live results disappoint.
A simple picture. Imagine a hundred coin flips, and a person searching for a pattern that predicts the next flip. If they try enough patterns, one of them will match the past flips well, by chance alone. It will look like a discovery. It is noise that was given a name. Now replace coin flips with price history and patterns with trading rules, and you have the problem in miniature. Market data is noisy, there are endless rules to try, and some rule will always fit.
The danger grows with the number of attempts. Each variation tried is another chance to get lucky. If someone tests five hundred variations and reports the best one, the honest description of that result is “the best of five hundred,” not “a rule that works.” The more settings a rule has, and the more you tune them against one stretch of history, the more likely you are describing that stretch rather than the market.
Here are signs to look for. A result that looks too smooth is one. Real strategies have ugly periods, and a curve with almost none deserves suspicion. Extreme sensitivity is another: if changing a setting slightly turns a great result into a poor one, the rule was fitted to a particular point, not to a feature of the market. Very specific rules built on short histories are a third; a rule that only works on one asset, in one year, with one oddly precise setting has little behind it. And the absence of any account of how many versions were tried is itself a warning.
There are sensible defences. Keep data aside that the rule never saw during design, then test on it once. Prefer fewer settings and simpler ideas that have an economic reason to work, not just a statistical one. Test across different periods and conditions, including ones that hurt. Check that small changes to settings do not wreck the result. Expect live behaviour to often be worse than the backtest, and be pleasantly surprised if it is not.
It also helps to remember what a backtest is for. It is a way to eliminate bad ideas cheaply, not a way to prove a good one. A rule that survives honest testing has earned the right to be watched in paper, where it faces data it has never seen (see why paper comes first), and its numbers still deserve a sceptical read (see simulated versus real results).
General educational commentary on testing methodology, not investment advice and not a description of any outcome. See our Risk Disclosure.