A hypothetical researcher ran a moving-average rule 40 times, changing its length n from 5 to 200 in steps of 5. Even after costs, n = 70 was best, with an annualized Sharpe ratio of 0.16. Before moving on to an out-of-sample segment (Lesson 590), we first want to measure how much this result leans on the single point 70 and on this one price path.
This lesson does that check with three calculations. They are parameter sensitivity, which looks at the results of neighboring values; results with the start date moved; and results on paths built by redrawing the same returns in blocks (the block bootstrap). A stress test with costs doubled is added. The lab extends the plateau of section 3 of Lesson 306 and the start-year check of section 5 of Lesson 305 into repeated calculations.
The data is synthetic data made with a fixed seed. Daily returns were drawn from a normal distribution with a mean of 0 and a standard deviation of 1%, and prices were built over 2,520 periods (about ten years if daily). The data is built to have no edge, so every good number here comes from luck and selection. The question of this lesson is how well the checks reveal that fact.
1. Write down the rule, the data and the check conditions first
The rule is a hypothetical teaching rule that changes only the length of Lesson 583's moving-average rule. If the close is above the n-period moving average, hold for the next period; otherwise cash, with the cash return set to 0. Holding set by the close of period t is attached only to the return of period t + 1 (shifting by one period). Costs are a one-way 0.1% multiplied by turnover, taken out in the period of the fill (Lesson 585).
The Sharpe ratio uses a risk-free rate of 0 and is annualized on the basis of 252 daily returns. On this path the asset itself fell. The daily average return came out at −0.02%, so simple holding had an annual compound return of −5.9% and a maximum drawdown of 57.6%. Even data built with a mean of 0 can rise or fall on a single path.
The check conditions were set before seeing results. If you choose conditions after seeing the results, the checks become one more trial.
| Check (hypothetical) | Pass condition |
|---|---|
| Parameter sensitivity | The Sharpe ratios of the two values right next to the chosen n are both at least half of the chosen value |
| Start date | With the end fixed and the start delayed by 0-756 periods, every annual compound return is above 0 |
| Block bootstrap | With block length 20 and 1,000 paths, the median annual compound return is above 0 |
| Doubled cost | At 0.2% one-way, the annual compound return is above 0 |
2. Parameter sensitivity: are the neighboring values good too
Lining up the 40 results in order of n gives the sensitivity curve. The after-cost Sharpe ratio is highest at n = 70, and right next to it 65 is 0.14 and 75 is 0.04. Of the 40, only 5 are above 0, the median is −0.17, and the worst, n = 5, is −0.61.

The pass condition is that both neighbors are at least 0.08, half of the chosen value. 75's 0.04 falls short, so the sensitivity check does not pass. The curve has only a small peak between 55 and 75, and the rest is below 0. In the words of section 3 of Lesson 306, it is closer to a lone hill than a plateau.
The whole curve moves down with costs. The before-cost Sharpe ratio of n = 70 was 0.28, but with an annual turnover of 12.5 times, a one-way 0.1% alone cut about 0.12. The shorter n is, the higher the turnover, so the left end of the curve drops more.
To see whether a plateau is reassuring, the same search was run on 21 synthetic paths that differ only in the seed (including this lesson's path). All of them were built to have no edge, yet the chosen value had a Sharpe ratio above 0 on 14 paths, ranging from −0.26 to 0.90. A wide plateau, with 30 or more of the 40 values of n above 0, also appeared on 5 paths.
On the seed 20261128 path, 39 of the 40 were above 0, with a median of 0.69. On that path, simply holding the asset had a Sharpe ratio of 0.74. If a path happens to rise, every rule that holds for even part of the time looks good, whatever n is. A plateau only means that the result does not lean on one n; it is not evidence that the rule caught something.
3. Start date: moving the start one period at a time
With the end left as it is, the start was delayed one period at a time from 0 to 756 periods (about three years), and the after-cost result of the n = 70 rule was computed 757 times. The annual compound return ranged from 1.1% to 3.7%, with a median of 2.6%, and the Sharpe ratio from 0.16 to 0.39. The worst value was the original result with the start not moved, and the best came from a start delayed by 498 periods.

All 757 are above 0, so the start-date check passes. But this pass is weaker evidence than it seems. The test segments with delayed starts are all part of the data already seen when n = 70 was chosen. Since the value that was best over the whole segment was chosen, it is natural for it to come out mostly good in parts of that segment too.
What the start-date check catches well is a different problem. It is the case where the result leans on a few large returns in the first few months. If moving the start makes the result collapse below 0, those few returns are carrying the whole. This time, the opposite was true: the early segment was cutting into the result.
4. Block bootstrap: building other paths from the same returns
The block bootstrap redraws the asset's daily returns at random in blocks and joins them into hypothetical paths of the same length. Within a block, the order of returns stays as it was, so short trends and clusters of volatility are preserved. Past the end, the draw wraps around to the start. With a block length of 20, 1,000 paths were built, and the n = 70 rule was applied again as it is.
The results are quite different from the original path. The annual compound return is −8.1% at the 5th percentile, −3.4% at the median and 2.7% at the 95th percentile, and only 15.8% of paths have an annual compound return above 0. The original path's Sharpe ratio of 0.16 sits at the 90.4th percentile of the bootstrap paths. The median annual compound return is below 0, so the bootstrap check does not pass.
Maximum drawdown splits even more. The original path's 23.8% is at the 3.7th percentile of the bootstrap paths, so most redrawn paths fell deeper than that. The median is 42.1% and the 95th percentile is 61.9%. A large part of the original path's small drawdown also came from the order of returns happening to line up luckily.

The block length changes the result. With blocks cut to 1, the median maximum drawdown is 45.5% and the share of paths with an annual compound return above 0 is 9.5%. With blocks of 60, they are 36.3% and 32.9%. The longer the block, the more of the original path's order it carries over. So set the block length from the properties of the data before seeing results, and write down the results for two or three lengths together.
The limits are clear too. Bootstrap paths only reshuffle the returns of this sample, so they cannot create crashes or regimes that were not in the sample. This distribution is not a distribution of the future but the range of orders this sample allows. If the sample mean is negative, as here, the redrawn paths also mostly fall.
5. Doubled cost and the one-line check result
Raising the one-way cost to 0.2%, the Sharpe ratio of n = 70 becomes 0.04 and the annual compound return −0.16%. The annual compound return is below 0, so the cost stress does not pass either. A rule whose result changes sign with 0.1 percentage point of one-way cost leans heavily on its fill assumptions (Lesson 585, Lesson 586).
The results of the four checks are sensitivity not passed, start date passed, bootstrap not passed, and doubled cost not passed. There is something not to do here. Changing the block length to 60, or lowering the neighbor condition from one half to one third, to make a pass would fit the checks to the result. If you want to change a condition, write it as a new version and keep it together with the results from before the change (Lesson 306).
The data was built to have no edge, so this result matches expectations. Conversely, even if all four checks had passed, the fact that the value was chosen from 40 trials would remain. Robustness checks only see whether a result leans on one point and one path; they do not replace the correction for the number of trials (Lesson 589) or out-of-sample testing (Lesson 590).
The record for this lesson is the robustness check table. Write the check conditions with a date from before seeing results, and keep in one table the sensitivity curve, the minimum and maximum by start date, the bootstrap percentiles by block length, the doubled-cost result and the number of trials.
Try it yourself
- From the sensitivity results, assume that n = 60 and n = 65 in turn are the chosen value, and check whether each passes the neighbor condition (the two values right next to it are both at least half of the chosen value). Write to three decimal places.
- From the bootstrap results, read the 5th, 50th and 95th percentiles of maximum drawdown for block length 20, and write in one sentence where the original path's maximum drawdown falls among them.
- In the start-date results, how many percentage points apart are the largest and smallest annual compound returns? Write why this check is weak evidence even though it passed.
- A colleague does not like the block length 20 result and suggests writing the report with the block length 60 result. Read the median annual compound return for block length 60 and write how you would answer.
Answers
First, the Sharpe ratio of n = 60 is 0.086, so half is 0.043, and its neighbor 55 is 0.042, just short. For n = 65, half of 0.135 is 0.068, and both neighbors, 60 (0.086) and 70 (0.158), exceed it, so it passes. But moving the choice to 65 after seeing the results also counts as a trial, and the fact that it was chosen from 40 trials stays the same.
Second, the 5th percentile is 24.9%, the median 42.1% and the 95th percentile 61.9%, and the original path's 23.8% is even below the 5th percentile. Most paths that put the same returns in a different order fell deeper, so do not read the original path's low drawdown as a property of the rule.
Third, 3.7% − 1.1% = 2.6 percentage points. The segments with delayed starts are all part of the data seen when n = 70 was chosen, so it is no surprise that the chosen value mostly comes out well within them. Use this check to catch results that lean on a few early returns, not as evidence for the chosen value.
Fourth, even with block length 60 the median annual compound return is −1.4%, so it does not meet the condition. Even if it had, changing the block length after seeing the result would fit the check to the result. In the report, use the result for the block length of 20 set in advance for the verdict, and write the results for 1 and 60 alongside as sensitivity to the block length.
Data: synthetic data (fixed seed 20261111, daily returns from a normal distribution with mean 0 and standard deviation 1%, 2,520 periods). The multi-seed check used 21 synthetic paths, seeds 20261111 through 20261131, and the bootstrap redrew the same asset returns with block lengths 1, 20 and 60, 1,000 paths each. Every number was read from results tables computed from this data.
