Skip to content
Wildflower
Join free
Not fooling yourself

Free Trading School · Level 4 · Course 4.3

Data mining and the many-tests problem

Lesson 9 of 18 in Not fooling yourselfModule 2: Overfitting

Testing and making it your own · Not fooling yourself

Data mining and the many-tests problem

Wildflower Trading School · Lesson 4.3.2.4

Wildflower

So far in this module, you've seen how one strategy can be tuned until it fits the past. This lesson zooms out. By the end of it, you'll know why testing lots of ideas or versions makes the best one look better than it really is. You'll see that in a simple classroom example. Then you'll meet the hidden tests that count too, and the habit of keeping count.

1 of 8

What you'll learn

  • Expect a lucky winner. Test enough versions and one looks great by chance alone.
  • Count the hidden tests. Dropped ideas, quick tries and scrolled charts count too.
  • Keep a test log. Write every version, what changed, why and the result.
  • Discount the best result. The more versions you tried, the more you take off.
  • Check the winner on fresh data. Write its reason first, then judge it once.

Exercise

  1. Start a test log: a simple sheet with columns for date, version, what changed, why, and result.
  2. Fill in every version of every strategy you've tried so far, as best you remember, including ideas you dropped.
  3. Count the rows.

Next: In-sample and out-of-sample data.

Quick check

  1. 1. Why does the best of 300 versions tend to look better than it really is?

  2. 2. You change a setting, look, and change it back. Does that count as a test?

  3. 3. What's the most direct check on a winner picked from many versions?

0 of 3 answered.

Finished this lesson?

Tick it off and keep your place

Make a free account and we'll remember where you are, so “In-sample and out-of-sample data” is waiting next time.

Read the full notes

Test enough ideas or versions on the same prices, and one will look great by chance alone, so the best of many is flattered by how many you tried. Keeping count and checking on fresh data guards against it.

  • Test enough ideas or versions on the same prices, and one will look great by chance alone. The best of many is flattered by how many you tried. This is called , or data snooping.
  • A quiz of 10 true-or-false questions, all guessed: 56 of the 1,024 ways to answer score 8 or more, about 5.5%. In a room of 30, the chance someone scores 8+ is 1 − 0.9453³⁰ ≈ 81.5%. The top scorer knows nothing.
  • Made-up example: 40 versions; the best averages per trade, the middle about 0R. Ask how good the best of 40 would look with no edge at all. See Comparing against random trades.
  • Hidden count too: ideas you dropped, settings tried "just to see", charts scrolled before deciding, and the many tests behind a famous idea.
  • Keep a test log of every version and result, discount the best more the more you tried, write the reason first, and judge the winner once on fresh data.

Worked example

Made-up numbers

A room full of guessers

Made-up numbers · 10 true-or-false questions · everyone guesses

  1. Ways to answer: 2¹⁰ = 1,024
  2. Ways to get 8, 9 or 10 right: 45 + 10 + 1 = 56
  3. One guesser: 56 ÷ 1,024 ≈ 5.5%
  4. 30 guessers: chance nobody scores 8+ is 0.9453³⁰ ≈ 18.5%, so someone does about 81.5% of the time

The top scorer guessed best out of 30 by chance, and isn't an expert. The best of many strategy versions works the same way.

Your turn

Drill

Made-up numbers · 6 entry rules · 4 stop sizes · 5 targets · every combination tested

Trading is risky. You can lose money. Test results are hypothetical, and a good test doesn't mean future profits. This lesson explains how testing works. It isn't advice.