Research method
System optimization: plateaus, trials and unseen data
System optimization searches a trading system's parameters for the values that scored best on past bars. 131 readings in the TradersWeek archive use it; in 23 it is the main subject, usually to ask how much of the best result was fit to noise.
- Output
- Research filter
- Input
- A fixed rule set, parameter ranges, a score to maximise, price history split into in-sample and out-of-sample parts, trading costs
- Horizon
- Set by the system being tuned; the history must hold enough trades in every part for the score to mean anything
- Best use
- Choosing parameter values for rules already written, and checking whether those values hold on bars they were not chosen on
- An optimizer always returns a best parameter set. Whether that set describes a rule or the noise of one sample is decided by data the search never saw.
- A broad plateau, where neighbouring values score about the same, says more than a single sharp peak that collapses one step away.
- Every combination tried is another chance to find a lucky one: the more trials, the higher the best in-sample score climbs by chance alone.
- Each free parameter is a degree of freedom. Few parameters and many trades leave the test something to judge; many parameters and few trades leave a fit.
- In the archive optimization sits most often beside mechanical trading systems (53 readings), walk-forward analysis (52) and robustness testing (39).
How the method is built, and where it has been read
Depends on
Often reviewed together
Seasonal trading5 readings
Often reviewed together
Relative Strength Index6 readings
Often reviewed together
Moving average8 readings
Often reviewed together
Rule-based entry9 readings
Often reviewed together
Robustness testing26 readings
Often reviewed together
Walk-forward analysis28 readings
Often reviewed together
Mechanical trading system35 readings
Read in the archive24 of 131 readings
What an optimizer actually finds
Optimization takes a system whose rules are fixed, lets a few numbers vary inside ranges (a lookback, a threshold, a stop distance) and runs the backtest for each combination. The output is the combination with the highest score on that history. The search cannot tell whether a set scored well because the rule captures something that repeats or because those values happened to dodge the worst trades of this sample.
That is why an optimized result is overfit by default. The best set is chosen because it scored highest on these bars, so the score is biased upwards. The question is not whether it is overfit, but by how much.
Plateau versus peak
Plot the score against two parameters and look at the shape around the best set. A plateau, a region where neighbouring values score about the same, means the result does not hinge on one exact number; a small shift in the market moves the system across flat ground. A lone peak that falls away one step to either side means the score depends on a value that was right for this sample and may be wrong for the next.
The number of trials
Each combination tested is one more draw. Search ten values and the best is a modest selection; search ten thousand and the best will look good even on random prices. Record how many combinations were tried and expect the winning score to shrink on new data roughly in step with that number.
Degrees of freedom
Every free parameter, filter and extra rule lets the system bend to more of the sample. With few trades and many parameters the system can effectively fit trades one by one. Fewer parameters, ranges set from the idea before the run, and a minimum number of trades per candidate keep the search honest.
The usual pitfall: optimizing on all of history
Searching over every available bar and reporting that result leaves nothing unseen. The figure is the best description of the past that the search could find, not an estimate of what the rules will do. Hold out a later part of the history before the search starts, run the chosen set on it once, and repeat the cycle in walk-forward windows to see whether the chosen values stay put.
Parameter set
Settings that decide how far an optimized result can be trusted
- freeParameters
- Free parameters
How many values the search may change: stop and target distances, ATR period, indicator lookbacks.
Default: 4 (stop, two targets, ATR period)Each one adds a degree of freedom; adding indicator periods on top widens the search and the room to fit noise. - searchSize
- Search size
How many candidate sets the search evaluates before it stops.
Default: 30 per generation, up to 20 generationsA larger search raises the best in-sample score by chance; the gap to out-of-sample grows with it. - minTrades
- Minimum trades
Closed trades a candidate needs before its score is ranked at all.
Default: 10A floor, not a sample: a Sharpe ratio built on ten trades can still be mostly luck. - holdout
- Out-of-sample share
Part of the history kept out of the search and used once to check the chosen set.
Default: 40% of each walk-forward window (4 windows)If the same bars are used to choose and to check, there is no check.
What 131 readings in the archive do with optimization
The TradersWeek research archive links system optimization to 131 readings: 16 in the 1980s, 45 in the 1990s, 26 in the 2000s, 37 in the 2010s and 7 in the 2020s. In 23 of them optimization itself is the main subject.
The most frequent companions are mechanical trading systems (53 readings), walk-forward analysis (52), robustness testing (39), rule-based entries (9) and moving averages (8). Sixty-nine readings pair optimization with walk-forward analysis, robustness testing or Monte Carlo simulation.
The readings return to four themes:
- Neighbourhoods over peaks. Readings from 1989 to 2017 map the score across parameter values and prefer sets whose neighbours score similarly, testing whether a plateau survives when the data shifts.
- Fewer degrees of freedom. Readings from 1986 to 2018 count parameters against trades, show that parameter grids can produce attractive results on random walks, and treat extra rules as a step away from generality.
- A holdout that can fail. Readings from 1988 to 2025 reserve a later sample, compare re-optimization schedules against random parameter choices and discard a rule set when it fails the held-out data instead of retuning it.
- What "best" means. Readings from 1984 to 2019 note that the score chosen decides the winner: net profit, a reward-to-risk ratio and the path of the equity curve rank the same grid differently, and genetic or stepwise searches only change how the candidates are found.
Where it fits in a workflow
Write the rules first, set parameter ranges from the idea and costs before any run, and keep a later slice of history out of reach. Optimize on the rest with as few parameters as the idea needs, look for a plateau rather than the top cell, check the chosen set out of sample and in walk-forward windows, then run it unchanged on paper.
On the TradersWeek chart
Strategy Builder, part of the Pro plan at $30/month, includes a genetic optimizer. By default it varies four risk parameters (stop 0.5–4 ATR, first target 1–6 ATR, second target 2–10 ATR, ATR period 7–21), and indicator periods detected in the strategy can be added with their own ranges. It evolves 30 candidates per generation for up to 20 generations and ranks them by Sharpe ratio; a candidate with fewer than 10 closed trades (adjustable) is not ranked. The search runs in the browser on all bars loaded on the chart, so its best set is in-sample.
The Heatmap tab bins the sets the optimizer actually evaluated on the first two parameters into a 10×10 grid and leaves unexplored cells empty, which is where a plateau or a lone peak shows up. The Pareto tab ranks sets on two of 12 goals at once. Walk-forward uses 4 windows of 60% in-sample by default and reports the median ratio of out-of-sample to in-sample Sharpe over windows with at least 5 trades in each half: Robust from 0.7, Acceptable from 0.4. The evolver, which builds rule sets itself, uses only the first 70% of history and marks entries that fail on the last 30% as Overfit. Monte Carlo runs 1,000, 5,000 or 10,000 passes over the trade list.
