TraderCoachTraderCoach
← All posts

Backtesting Overfitting: What Unseen Data Taught Eli About Trusting a Strategy

Two men reviewing stock market data on a tablet, pointing at charts.

AlphaTradeZone

Repeatedly tuning a strategy on the same historical data can make a backtest look perfect while making its future performance less trustworthy. The fix is to separate the data used to develop rules from data used to test them, then use forward testing before risking capital.

At 10:47 p.m. on a Sunday, Eli sat at his kitchen table in Manchester with a cooling mug of tea beside his laptop. His chart showed a strategy that had finally stopped losing. Each time he found a weak stretch, he changed something: the entry threshold, the stop distance, the time of day, the indicator setting.

The red trades had disappeared one by one.

By midnight, the equity curve rose smoothly across months of historical candles. The drawdown looked manageable. Eli hovered over the button that would turn the rules into a live trading plan for Monday morning.

A losing week could damage a small account. A strategy built around a chart that only looked safe in hindsight could do more than miss a target. It could teach him to trust rules that had never faced an unseen market.

How a clean backtest learns the past too well

A backtest answers a narrow question: how would these exact rules have behaved on these exact historical prices?

That answer becomes less useful when the same history is used to invent the rules, identify their failures, revise them, and validate the final version. Each adjustment may feel sensible. Eli could point to a bad trade and explain why a tighter filter would have avoided it.

The problem was the sequence. He kept looking at the answers before setting the test.

Historical markets contain real patterns, but they also contain random runs, unusual news reactions, and price moves that happened once. When you tune enough settings against the same chart, a rule can begin to fit those accidents. The strategy does not need to identify a durable trading opportunity to produce a satisfying curve. It only needs to explain what already happened.

That is overfitting. It often arrives quietly, disguised as diligence.

A rule that says “avoid entries after a sharp move” may reflect a sound risk principle. A rule that avoids entries only during one narrow set of past conditions may reflect the handful of losing trades you wanted to erase. The second rule can look smarter in a backtest while becoming more fragile in live conditions.

Keep an unseen period for the real test

Eli’s turn came when he copied his final rules into a fresh worksheet and realized every period on the chart had already influenced a decision. There was no untouched history left to test.

He split the process into two parts.

First, he chose a development period. This was the data where he could form an idea, define entries and exits, and make a limited number of rule changes. Then he set aside a later period that he would not inspect while tuning.

Only after the rules were written did he run them against that unseen period.

The result was less flattering. A few trades that his revised rules had avoided in the development period returned in the holdout data. The equity curve bent. The max drawdown grew. That did not automatically make the strategy useless. It gave Eli a more honest question: could he accept this behavior, or did the approach depend too heavily on a particular slice of history?

A backtest with losses can still be useful. It shows the range of outcomes a rule has already experienced. The goal is not to remove every losing trade. The goal is to learn whether the rules have a reason to exist beyond the chart that helped create them.

Forward testing exposes the decisions a chart cannot show

Out-of-sample testing still uses history. Forward testing adds something historical data cannot provide: decisions made before the next candle arrives.

Eli paper-tested his rules for several weeks. Before each session, he wrote down what qualified as an entry, where the trade would be invalidated, and how much of the account he was prepared to risk. He recorded skipped signals too. A trading journal needs the trades you rejected, because those are often where discipline either held or broke.

This process also revealed friction that the backtest had hidden. A setup could appear at an inconvenient time. A stop could require more distance than his position-sizing rule allowed. Several similar signals could appear together, concentrating risk in one market move.

Those are approval decisions, not chart settings. They deserve the same attention as entries.

An approval-gated workflow can create a useful pause here. A queued trade gives you a moment to review the reason for the signal, the position size, the stop, the broader exposure, and the conditions that would cancel the plan. That pause matters most after a strategy has impressed you. Confidence is when weak assumptions can pass without review.

For a related example of reviewing risk before acting, see What Should You Review Before Approving a Fourth Alert After Three Losses?.

Write limits before you see the next result

By the following Sunday, Eli’s worksheet looked less polished. It had losing stretches, missed trades, and notes beside signals that no longer fit the original idea. It also had something his first backtest lacked: rules written before the outcomes were known.

He kept the strategy in testing. He set a limit on how often he could change a rule, recorded why each change was necessary, and required a new unseen period after a material revision. If a change only improved a known historical trade, he treated that as a warning rather than proof.

The same discipline applies to risk. Define position size from a planned loss and invalidation level, not from the smoothness of an optimized equity curve. What Is Your 2% Risk Actually Based On? explores that decision in more detail.

On Monday, Eli did not need a perfect chart to know what to do. He needed a plan that could survive being wrong.

Educational content, not financial advice.

TraderCoach

Nokware is an approval-gated AI trading assistant for crypto and stocks: the AI generates and queues trade signals, and a human approves or rejects each one before anything executes — you always keep the final decision, and it never trades unsupervised.

Try TraderCoach

Comments

No comments yet.