Parameter Stability Analysis - Why It Matters in Optimization
How to tell a robust parameter region from a lucky peak: one-parameter sweeps, two-parameter heatmaps, neighbourhood averages, sensitivity tests and how to pick final settings.
The highest number in an optimisation table is rarely the best choice. What matters is how results behave around it. Parameter stability analysis looks at the shape of the results across parameter values to separate real effects from lucky coincidences.
Peaks and plateaus
Imagine two results from optimising a moving-average length:
- Peak: length 37 gives profit factor 2.2; lengths 35 and 39 give 1.1 and 0.9.
- Plateau: lengths 30-50 all give profit factors between 1.4 and 1.6.
The peak is almost certainly luck. Nothing about markets makes 37 special while 35 and 39 fail. The plateau tells a different story: the strategy works across a range of similar settings, which is what you would expect if it captured a genuine tendency of the market.
Markets drift. The volatility and rhythm that made a parameter optimal last year will be slightly different next year. A setting from the middle of a plateau keeps working when the market drifts; a setting on a peak falls off it.
Tool 1: one-parameter sweeps
Hold everything else fixed and run the strategy across one parameter’s range. Plot the result (profit factor, expectancy or return over drawdown) against the parameter value.
Read the chart:
- Flat, positive region - good candidate area.
- Smooth hill - choose near the top, but not on the edge.
- Jagged line - results are dominated by noise; be suspicious of the whole strategy.
- Single spike - ignore it.
Also plot the number of trades. A region where performance rises only because the trade count falls to a handful is not stable, it is thin.
Tool 2: two-parameter heatmaps
For two parameters, a heatmap shows results as colours on a grid: one parameter on each axis. Robust strategies show islands - connected areas of good results. Fragile ones show scattered bright cells surrounded by poor ones.
Practical tips:
- Use a metric that includes risk (return over drawdown) rather than raw profit.
- Use the same colour scale for different runs so you can compare them.
- Look for an island that survives when you change the test period.
Tool 3: neighbourhood averaging
Rank passes not by their own result, but by the average of their neighbours - for example, all passes within one step in every parameter direction. This simple smoothing pushes isolated peaks down and broad regions up. The pass with the best neighbourhood average is often a much better choice than the raw winner.
Tool 4: sensitivity tests
Once you have candidate settings, change each parameter by ±10%, ±20% and ±30% and record the result. A robust choice degrades gradually. If a 10% change halves the profit factor, the strategy is too sensitive to be traded with confidence.
Do the same for market conditions:
- Test on each year separately.
- Test with higher spread and commission.
- Test on a related instrument with similar behaviour.
Parameters that only work in one year are tuned to that year.
How to choose the final values
- Identify the stable region on the development data.
- Choose a value from its centre, not its best cell.
- Check that the trade count there is large enough.
- Confirm the choice on out-of-sample data or with walk-forward analysis.
- Record the whole region, not just the chosen value. If live behaviour changes, knowing the region tells you whether a small adjustment is safe or the strategy needs a full review.
A worked example
A grid bot for gold has two key parameters: grid spacing (in ATR multiples) and basket take profit (in ATR). A 10 × 10 optimisation produces a heatmap where:
- the single best cell is spacing 0.6, take profit 1.4, with a return/drawdown of 4.1 and only 40 baskets;
- a connected island spans spacing 0.9-1.3 and take profit 0.8-1.2, with return/drawdown between 2.2 and 2.8 and 150-210 baskets.
The island is the sensible choice. Its centre - spacing 1.1, take profit 1.0 - remains reasonable when spread is doubled and when each year is tested separately. The best cell does not survive either test.
In cTrader
cTrader’s optimisation results list every pass with its parameters and statistics, and passes can be exported. A one-parameter sweep is easy to read directly from the table sorted by the parameter. For two-parameter heatmaps, export the passes and build the grid in a spreadsheet: put one parameter in rows, the other in columns, and colour the cells by your chosen metric.
Key takeaways
- Stability across neighbouring values matters more than the single best result.
- Use sweeps, heatmaps, neighbourhood averages and sensitivity tests to find plateaus.
- Choose from the centre of a stable region with enough trades.
- Confirm the choice on data the optimisation never saw.
Related: over-optimisation and best practices for robust optimisation.
FAQ
What is a parameter plateau?
A region of parameter values where results stay similar when you move the settings a little. It suggests the strategy is capturing a real effect rather than a lucky coincidence at one exact value.
Should I pick the best-performing pass?
Usually not. Pick a value from the middle of a stable region, even if its in-sample result is lower than the peak. It is more likely to keep working when market conditions shift slightly.
How wide should a stable region be?
Wide enough that a realistic change in market behaviour would keep you inside it. As a practical check, results at roughly ±20% of the chosen value should stay in the same quality band.
Sources and further reading
- cTrader Help: Optimise a cBot (passes and parameters) - help.ctrader.com
- Bailey et al.: The Probability of Backtest Overfitting - papers.ssrn.com