Choose a parameter platform instead of a backtest peak
When one stock strategy configuration has an exceptional backtest score and neighboring configurations disappoint, the first task is to inspect the search map. Selecting the highest cell hides whether the result belongs to a broad acceptable region, an isolated peak or an incomplete neighborhood. A parameter platform is a deliberately defined connected set of completed, acceptable runs. Its existence describes this search, not future stability.
This guide takes a frozen two-dimensional result matrix and produces a region ledger and one representative configuration. All scores are invented dimensionless demonstration values, not stock returns. The procedure is an external research method. It does not establish a CoTrading capability, perform retraining or claim that slicing an existing equity curve into windows implements walk-forward optimization.
Obtain the actual run matrix
Begin with one strategy, one market and one currency under a common data snapshot, engine, scoring interval and execution assumptions. For every cell retain its configuration, run identifier, completion status, net score and any required risk or trade-count fields. Join results by parameter values rather than spreadsheet row position. Duplicate results require an explicit version choice; averaging conflicting attempts can conceal a reproducibility problem.
Include points that failed the acceptance rule and points that never completed. A negative score is observed evidence. A missing score is an information gap. Assigning both the same numeric zero loses that distinction. Invalid combinations should also have their own state, because a structurally prohibited point cannot become an unexplored bridge between two regions.
The scikit-learn search documentation describes parameter spaces, candidate evaluation and scoring as distinct search ingredients. Our region rule below is an original post-search selection procedure, not a feature or guarantee of that library. In a stock application, evaluation design must respect time ordering and the strategy contract; copying a generic classifier validation example would not establish an appropriate trading experiment.
Define acceptance and adjacency before selecting a winner
For the demonstration, accept an observed cell when its score is at least 5. Define adjacency by one grid step along exactly one axis. Diagonal contact does not count. Retain only connected regions containing at least four acceptable cells. These thresholds are illustrative choices that must be fixed before the final holdout is examined; they are not financial standards or universal measures of robustness.
Define the coordinate system too. Here a step means neighboring positions in the listed parameter arrays, not a fixed numerical difference. With an irregular grid such as lookbacks 2, 3 and 30, that definition may connect economically distant settings. Either choose a justified grid beforehand or define an explicit maximum parameter distance. Record that choice rather than adjusting adjacency until the preferred peak joins a region.
If real research uses return, drawdown and minimum trade-count gates, evaluate every gate at each cell. Keep the reason a point fails. A connected region can still share a serious hidden weakness, such as the same small number of profitable events, so geometric breadth alone is not sufficient evidence of an investable strategy.
Work through a complete synthetic map
Fast values are 2, 3, 4 and 5; slow values are 10, 12, 14 and 16. The following matrix is the entire input, with a missing value deliberately preserved:
| Fast / slow | 10 | 12 | 14 | 16 |
|---|---|---|---|---|
| 2 | 6 | 7 | -2 | 1 |
| 3 | 7 | 8 | -1 | 2 |
| 4 | -3 | -2 | missing | 1 |
| 5 | 1 | 0 | 2 | 25 |
There are sixteen planned cells, fifteen observations and one missing result. Five observations meet the score threshold. Four occupy the upper-left square; the fifth is score 25 at fast 5, slow 16. Under four-neighbor adjacency the acceptable component sizes are four and one. Only the four-cell region meets the minimum region size.
This rejects the largest score as an isolated peak. It does not prove that score 25 is a mistake or that its future performance will be poor. The decision follows a prespecified preference for a connected region and explicitly sacrifices the observed maximum. Keep the peak in the report so a reviewer can see what was rejected and why.
Compute components without inventing results
Build a set of observed acceptable coordinates, then traverse neighbors using a queue. The Python deque documentation describes the standard-library container used here. The queue mechanism only visits recorded acceptable points; it neither interpolates scores nor fills failed runs.
from collections import deque
good = {(i, j) for i, row in enumerate(scores)
for j, value in enumerate(row)
if value is not None and value >= 5}
while good:
first = min(good)
good.remove(first)
queue = deque([first])
region = [first]
while queue:
i, j = queue.popleft()
for p in [(i-1, j), (i+1, j), (i, j-1), (i, j+1)]:
if p in good:
good.remove(p)
queue.append(p)
region.append(p)
The full example repeats the outer traversal until every acceptable cell belongs to exactly one component. Check that the sum of component sizes equals the acceptable-cell count. A chart may use a smooth color palette for readability, but the underlying selection must operate on actual recorded cells. Include status markers and coordinates so a visual gradient cannot be mistaken for measured evidence between runs.
Select a representative with a deterministic rule
Within an eligible component, choose the point minimizing the sum of Manhattan grid distances to every member. This is a grid medoid rule. Break equal-distance ties by the higher observed score and then by coordinate order. The rule is deterministic and selects a measured configuration, unlike an arithmetic center that may fall between grid points.
All four points in our square have equal distance sums. The score tie-break therefore selects fast 3, slow 12, score 8. Its region members are fast/slow pairs 2/10, 2/12, 3/10 and 3/12, with scores 6, 7, 7 and 8. Save those member run references with the selection record. A reviewer should be able to open each actual result rather than accept a screenshot of the platform.
If several eligible components remain, apply another rule fixed in advance, such as larger size followed by a higher minimum score. If that rule was not specified, report the ambiguity and decide a new exploratory selection policy before opening the holdout. Do not use unseen-period results to choose the region and then describe the same period as independent confirmation.
Test the missing-bridge counterexample
A different failure mechanism appears in the one-row input [6, None, 7]. Both observed endpoints pass the score gate, but the middle point has no result. The traversal returns two singleton components. With a minimum region size of two, neither qualifies. Filling the middle point with the average would manufacture a three-cell platform from two observations.
Treat the gap as a pending research task if completing it is permitted under the frozen development plan. A successful rerun may connect the endpoints, while a failed or low-scoring result may keep them apart. Version the map when evidence changes and retain the earlier missing state. Do not overwrite a failed status with a visually convenient estimate.
Run python docs/growth/research/round-5/examples/R607.py. The actual output reports cells=16 observed=15 missing=1 acceptable=5, component_sizes=[4, 1], and selected_fast=3 selected_slow=12 score=8. Assertions also reject the isolated score 25 and verify missing_bridge_sizes=[1, 1]. This execution checks the region algorithm on synthetic scores; it does not validate the scores themselves.
Accept the candidate and retain the search history
The deliverable includes the raw matrix, status map, gate and adjacency definitions, component membership, tie-break rule and representative configuration. Confirm that every member maps to a completed run under the same context and that missing values never become numeric results. Preserve all rejected cells and any exploratory changes to thresholds.
Freeze this candidate and its selection record before an independent holdout test. Recompute the map if a run is corrected, a cost assumption changes, the grid expands or an input snapshot is revised. Label the new map as a new analysis. Neighbor similarity cannot remove common data errors, multiple-search bias or regime dependence; the practical value of the platform rule is a transparent, reproducible selection decision with inspectable boundaries.
Keep geometric evidence separate from economic evidence
The region ledger should list each member’s coordinates, run reference, score and acceptance reasons, plus its observed boundary neighbors. For our selected point, the square is fully observed, while the gap elsewhere remains explicitly unknown. If a real selection rule includes a minimum number of trades, save that count for every member; a high score with too few observations must not enter the region simply because the color looks attractive. Inspect whether all members depend on the same exceptional event and record that as a remaining economic question. None of these checks warrants changing the four-neighbor rule after seeing the map; a revised rule belongs to a new exploratory analysis.
Download the complete example. Use Python 3.12 or later and run python R607.py in the download directory. It uses only the standard library and synthetic inputs.
FAQ
Is the largest connected region always best?
No. Region size is one chosen selection criterion. It may be inappropriate when the grid spacing or acceptance gate lacks a defensible rationale.
Can the center be a parameter value that was never run?
Not under this procedure. The medoid selects an observed member; an untested interpolated center requires its own run and a new record.