Every strategy has settings: the length of an average, the size of a stop, the time window. Trying several values and comparing them is called optimizing. By the end of this lesson, you'll know why picking the single best result is a trap, and how to look for a stable zone of settings instead. You'll also learn a simple sum that shows the difference, and what a stable zone can and can't tell you.
1 of 8
What you'll learn
- Spot the chance winner. The single top setting often tops the list partly by luck.
- Look for a steady zone. Nearby settings that all do fairly well are easier to trust.
- Average the neighbours. The top setting can sit in a weak neighbourhood.
- Change one thing at a time. Choose spaced values first and write down every result.
- Test the zone on fresh data. A zone shares the same prices and the same chance effects.
Exercise
- Pick one setting of a strategy you've tested, such as the An order that closes a trade if price reaches a level you set against it. It aims to limit the loss, but in a fast market it can fill at a worse price.More in the glossary size or an average length.
- Choose three values spaced well apart, write them down, and replay the same dates with each.
- Draw the three results as bars and note whether they look like a peak or a zone.
Quick check
1. Length 20 is the top result, but 15 and 25 are poor. What does that suggest?
2. Results for 40, 45 and 50 are +0.12R, +0.15R and +0.12R. What is the neighbour average for 45?
3. Why can't a steady zone prove a strategy works?
0 of 3 answered.
Finished this lesson?
Tick it off and keep your place
Read the full notes
When you try several settings, the single top result is often partly chance. A steady zone of settings that all do reasonably well is easier to trust, though it still needs testing on fresh data.
- Optimizing means trying several values of a setting on the same past prices and comparing results. Picking the single top result is where Tuning a strategy’s rules so closely to one stretch of past prices that they describe that stretch’s quirks more than anything that carries on.More in the glossary creeps in, because one of many values will top the list partly by chance.
- Made-up example: lengths 10 to 60. Length 20 tops the list at A result measured in units of the amount at risk. If a trade risks 4 points, 1R is 4 points and a 6-point gain is +1.5R.More in the glossary per trade, but 15 and 25 give −0.04R and +0.02R. Lengths 35 to 50 all give +0.11R to +0.16R: a steady zone.
- Neighbour average: length 20 = (−0.04 + 0.30 + 0.02) ÷ 3 ≈ +0.09R; length 45 = (0.15 + 0.16 + 0.14) ÷ 3 = +0.15R. The top setting has the weaker neighbourhood.
- By hand: choose a few well-spaced values first, keep everything else the same (Comparing two versions fairly), write down every result, look for zones.
- A steady zone shows the result doesn't hang on one number. It can't show the zone is real, because every setting in it shares the same prices and the same chance effects. It still needs out-of-sample testing.
Worked example
Made-up numbersAverage the neighbours
Made-up numbers · average result per trade by The average of the last few closing prices, worked out again on every candle and drawn as a line.More in the glossary length
- Length 20: (−0.04 + 0.30 + 0.02) ÷ 3 = 0.28 ÷ 3 ≈ +0.09R
- Length 45: (0.15 + 0.16 + 0.14) ÷ 3 = 0.45 ÷ 3 = +0.15R
The setting with the best single result sits in the weaker neighbourhood.
Your turn
DrillMade-up numbers · length 35: +0.11R · length 40: +0.15R · length 45: +0.16R
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.