TL;DR: Post #16 ended with a pre-commitment: same script, no limit, stop 2×ATR, 15-bar time exit — the middle point, to check whether 10 → 15 → 20 is a slope or noise. The answer is in, and it is not the answer I expected: net −$249.40, Profit Factor 0.967, in our testing — the 15-bar hold is worse than both ends. 10 bars: +$2,420.59 / 1.378. 15 bars: −$249.40 / 0.967. 20 bars: +$1,578.25 / 1.200. The entry stream is byte-identical (49 = 49 = 49), so every dollar of the −$2,669.99 against #15 is an exit effect, and it decomposes cleanly: the 27 trades that survived to bar 15 lost 808.74 points against their bar-10 exits, and 3 more trades died to the stop in the extra window for another −119.90 points. And the concentration check fails harder than ever: net minus the biggest trade is now −$1,425.16 — without one trade, the strategy is underwater at all three holds. There is no slope here. The hold is noise in this range, and #15's "profitable" variant was the lucky draw.
| Hold 10 bars (#15) | Hold 15 bars (#17) | Hold 20 bars (#16) | |
|---|---|---|---|
| Closed trades | 48 | 48 | 48 |
| Stop exits | 18 | 21 | 24 |
| Time exits | 30 | 27 | 24 |
| Net profit | +$2,420.59 | −$249.40 | +$1,578.25 |
| Profit Factor | 1.378 | 0.967 | 1.200 |
| Win rate | 23 / 48 (47.9%) | 18 / 48 (37.5%) | 19 / 48 (39.6%) |
| Gross profit | +$8,830.95 | +$7,207.18 | +$9,469.73 |
| Gross loss | −$6,410.36 | −$7,456.58 | −$7,891.48 |
| Avg win / avg loss | $383.95 / −$256.41 | $400.40 / −$248.55 | $498.41 / −$272.12 |
| Avg hold | 7.77 bars | 10.67 bars | 13.31 bars |
| Max equity drawdown | $1,927.79 (19.02%) | $2,191.46 (21.08%) | $1,783.16 (17.44%) |
| Top-5 winners' share | 55.7% | 55.6% | 53.0% |
| Net minus trade #45 | +$88.60 | −$1,425.16 | +$100.47 |
The contract: one question, chosen before I looked
Post #16 pre-committed this test, word for word: same script, no limit, stop 2×ATR, 15-bar time exit. The contract for this post is three questions, in order:
- Does 15 land between 10 and 20 — is the hold a slope, or noise?
- Is the comparison clean this time, or does the entry stream move again?
- If 15 is the worst of the three, what exactly eats it — the trades that survive longer, or the ones that don't survive at all?
The script is post #5's fixed RSI mean-reversion strategy, byte-identical apart from the maxHold default and the title string — the compiled .py diffs clean against the #15 base except for two lines. Zero diagnostics from the local compiler. Same 4,089 daily bars of CSI 300 (2010-01-04 → 2026-11-06), same $10,000, same PyneCore patched runtime, no commission, no slippage.
The one-line change, in Pine:
maxHold = input.int(15, "Max hold (bars)", minval=1) And the compiled Python, verbatim from the local compiler (node bin/pine2pyne.mjs, zero diagnostics) — the only lines that differ from the #15 run:
_pyne_in_maxHold: int = input.int(15, "Max hold (bars)", minval=1) What you're checking here:
- Does the middle hold land in the middle — or does the curve have no shape at all?
- Does a bracket change touch the entry stream again, like it did in #14?
- If the "profitable" variant was luck, which trade proves it?
Probe 1: the exit split — the stop takes a third trade, the time exit pays less
| Exit reason | Trades | Wins | Net | Avg per trade | Avg hold |
|---|---|---|---|---|---|
| Stop (2×ATR) | 21 | 0 | −$6,513.94 | −$310.19 | 5.1 bars |
| Time (15 bars) | 27 | 18 | +$6,264.54 | +$232.02 | 15.0 bars |
Three more stops than #15, three fewer time exits — the same three trades, as Probe 2 shows. The stop column is still winless (21 of 21 losses) and still the largest loss column. The time exit's average fell below both ends (+$273.30 at 10 bars, +$368.37 at 20, +$232.02 at 15) — the trades that survive 15 bars are worth less each than the ones that survive 10 or 20. That is already suspicious: if the hold were a slope, the middle average should sit in the middle. It doesn't.
Two verdicts hiding in that table:
The middle hold bought neither patience nor protection. At 10 bars the time exit averaged +$273.30; at 20 it averaged +$368.37; at 15 it averaged +$232.02 — the worst of the three. The extra 5 bars didn't filter for better trades. They just moved the exit to a worse neighbourhood.
The stop is still the strategy. 21 of 48 exits are stops, 0 wins, −$6,513.94 — larger than the time exit's net (+$6,264.54). The strategy loses money on the stop column alone by more than it makes on the time column. At 10 bars the two columns were −$5,778.55 and +$8,199.14. The stop got worse faster than the time exit did.
Probe 2: the matched 49 — where the $2,669.99 went
The entry stream did not move at all: 49 entries in #15, 49 in #16, 49 in #17, identical bars, identical prices. The comparison is fully clean for the third time running: same entries, different exits, and the delta is purely an exit effect.
| Transition (#15 → #17) | Trades | Dollar delta | Point delta |
|---|---|---|---|
| TIME → TIME | 27 | −$2,368.57 | −808.74 pts |
| TIME → STOP | 3 | −$383.83 | −119.90 pts |
| STOP → STOP | 18 | +$82.41 | +0.00 pts |
| OPEN → OPEN | 1 | — | — |
| Total | 49 | −$2,669.99 | −928.64 pts |
Read the point column before the dollar column — the rule from #15. In points, the 18 stops are worth exactly what they were worth in #15 (+0.00 pts), and the dollar difference (+$82.41) is sizing only: trade #41 entered with one fewer contract in this run, so the same stop cost $82.41 less. All −928.64 points of the decline come from the 27 trades that survived to bar 15 (−808.74 pts) plus the 3 that died to the stop in the extra window (−119.90 pts). No confound, no entry drift.
The dollar delta (−$2,669.99) is worse than the point delta implies, for the same sizing reason as #16: the account was smaller by the time the late trades entered, so the same points are worth fewer dollars. Trade #45 is the case to see in full — and it is the whole story in miniature:
- Trade #45 (entry 2024-09-20 @ 3,192.43): #15 exited at bar 10 for +$2,331.99 (3 contracts, +777.33 pts, 2024-10-11 @ 3,969.76). #17 held to bar 15 for +$1,175.76 (2 contracts, +587.88 pts, 2024-10-18 @ 3,780.31). #16 held to bar 20 for +$1,477.78 (2 contracts, +738.89 pts, 2024-10-25 @ 3,931.32). The rally trade's exit price by hold: 3,969.76 → 3,780.31 → 3,931.32. The price dipped between bars 10 and 15 and recovered by bar 20 — and the 15-bar exit caught the dip. Of the −$1,156.23 against #15, −$568.35 is price (−189.45 pts × 3 contracts) and −$587.88 is one fewer contract. The middle hold is the worst exit for the single most important trade in the strategy, on price alone.
Probe 3: the curve has no shape — 15 loses to 20 as well
If 10 → 15 → 20 were a slope, 15 would beat one end and lose to the other. It loses to both. Matched against #16 (hold 20):
| Transition (#16 → #17) | Trades | Dollar delta | Point delta |
|---|---|---|---|
| TIME → TIME | 24 | −$2,425.00 | −967.03 pts |
| STOP → TIME | 3 | +$514.95 | +215.42 pts |
| STOP → STOP | 21 | +$82.41 | +0.00 pts |
| OPEN → OPEN | 1 | — | — |
| Total | 49 | −$1,827.65 | −751.61 pts |
The 24 trades that survived to bar 20 in #16 lost 967.03 points by exiting at bar 15 instead — the extra 5 bars from 15 to 20 were genuinely good to them. The only offset is the 3 trades that died between bars 16 and 20 in #16 but survived to bar 15 in #17 (#27: stop −$254.08 at hold 17 → time +$91.12; #42: −$252.32 → −$118.74; #44: −$159.87 → −$123.70 — together +$514.95, +215.42 pts). Three trades saved, twenty-four trades short-changed.
The worst of the 24, named: trade #23 (entry 2016-02-01 @ 2,939.04) exited at bar 15 for +$1.08 — a round trip to nothing — after being +$434.67 at bar 10 and +$509.88 at bar 20. The price was flat at bar 15, up by bar 20. There is no rule that would have known that at bar 15. And trade #19 (entry 2015-07-07 @ 3,877.85): +$463.82 at bar 10, −$373.76 at bar 15, −$100.96 at bar 20 — the 15-bar exit is the worst of the three for this trade too, by 136.40 points against the 20-bar exit.
Three points, no monotone trend: +2,420.59 → −249.40 → +1,578.25. The honest conclusion is not "15 is bad". It is "the hold, in this range, is noise — and #15's profit was the draw, not the parameter."
Probe 4: six winners became losers in five bars
Of the 27 TIME → TIME trades, six flipped from winners at bar 10 to losers at bar 15 — and only one flipped the other way (#20: −$112.50 → +$132.26, +103.63 pts). A seventh, #23, stayed a winner on paper only:
| Trade | Entry | #15 at bar 10 | #17 at bar 15 | Point swing |
|---|---|---|---|---|
| #19 | 2015-07-07 @ 3,877.85 | +$463.82 | −$373.76 | −418.79 pts |
| #31 | bar 2813 | +$266.12 | −$8.21 | −141.27 pts |
| #23 | 2016-02-01 @ 2,939.04 | +$434.67 | +$1.08 | −144.35 pts |
| #39 | bar 3259 | +$192.94 | −$47.90 | −120.42 pts |
| #44 | bar 3525 | +$12.94 | −$123.70 | −68.32 pts |
| #13 | bar 649 | +$53.13 | −$86.96 | −39.45 pts |
| #16 | bar 846 | +$83.12 | −$3.68 | −21.70 pts |
That is six outright flips plus one near-total give-back, against a single loss-to-win flip. The extra 5 bars are not a filter that keeps winners and drops losers. They are a coin flip with a stop underneath it — and at 15 bars the coin came up tails more often than at 10 or 20.
Probe 5: the three that didn't survive — named, not counted
The 3 TIME → STOP trades, each with its bar-10 outcome in #15:
| Trade | Entry | #15 at bar 10 | #17 outcome | Hold |
|---|---|---|---|---|
| #6 | 2011-06-01 @ 2,996.08 | −$169.20 | −$274.48 stop | 11 |
| #12 | 2012-07-02 @ 2,473.54 | −$62.85 | −$244.92 stop (gap) | 11 |
| #17 | 2013-12-24 @ 2,291.12 | −$201.92 | −$298.40 stop (gap) | 12 |
The same three trades that died first in #16 — #6, #12 and #17 are the first three of #16's six, and they die in the same bars here (11, 11, 12). The other three of #16's six (#27, #42, #44) survive to bar 15 in this run and are worth +$514.95 against their #16 stops — Probe 3's only offset. The stop collects the same trades first at every hold; the only question is how many more it gets before the time exit fires. At 15 it gets 3 of the 6. At 20 it gets all 6.
Probe 6: the concentration check fails hardest
Same check as #15 and #16, same verdict — worse. The top 5 winners are $4,005.08 of the $7,207.18 gross profit — 55.6%. And one trade still does almost all the work:
| Trade | Entry | Exit | Hold | Profit |
|---|---|---|---|---|
| #45 | 2024-09-20 @ 3,192.43 | 2024-10-18 @ 3,780.31 | 15 bars (time) | +$1,175.76 |
| #14 | — | — | 15 bars (time) | +$925.24 |
| #5 | — | — | 15 bars (time) | +$706.11 |
| #11 | — | — | 15 bars (time) | +$659.97 |
| #29 | — | — | 15 bars (time) | +$538.00 |
The honest arithmetic, again: net −$249.40 minus trade #45 = −$1,425.16. At 10 bars it was +$88.60, at 20 bars +$100.47 — both breakeven without the one trade. At 15 bars it is outright negative. All three "profitable or near-profitable" variants agree on exactly one thing: the profit is one trade deep, and at the middle hold even that trade isn't enough to carry the rest.
One more comparison the headline hides: #17 loses to buy & hold (+$1,468.22 on the same span) by $1,717.62. At 10 bars the strategy beat doing nothing by $952.37; at 20 bars by $110.03. At 15 bars it is worse than doing nothing by more than the price of three average losing trades.
Probe 7: the gap-through — same five fills, same 81.12 points
Of the 21 stops, 5 filled at the exit bar's open — the identical five as #16, same 81.12 points of extra loss vs the level the script actually set:
| Gap fills | Extra vs level | |
|---|---|---|
| Stop exits | 5 of 21 | −$243.35 (81.12 pts) |
The verification holds: every non-gap stop fill lands exactly on the level computed from the previous bar's ATR (distance 0.0000 ATR), same as #13, #14, #15 and #16. The five gap trades are #2, #12, #17, #21 and #48 — #12 and #17 are two of Probe 5's three, so the extra window's stop deaths include two gap-throughs. The longer the hold, the more bars in which to gap through — but 15 and 20 gap identically here, because the gap trades all die by bar 12.
Rules I now follow
- Count exits by reason before tuning anything. (From #13 — still the first rule. The stop column went 18 → 21 → 24 and the story is still in the exit split, not the net.)
- A bracket change is an entry change — until proven otherwise. (From #14. This time the entry stream provably didn't move for the third run in a row: 49 = 49 = 49, identical bars. Report the entry count alongside the exit count, or the net comparison is fiction.)
- Match trades before claiming an effect. (From #14. Same entry, different exit is the only clean comparison — and this post has two of them: against #15 and against #16.)
- Measure in points before dollars when sizing is percent-of-equity. (From #15. Trade #41's +$82.41 on +0.00 points is the proof again — the dollar number alone would invent an effect where there is only a contract count.)
- A first profitable variant is a suspect until the concentration check clears it. (From #15. This one doesn't clear it either: 55.6%, and −$1,425.16 without trade #45 — the first variant in the series where removing one trade flips the sign.)
- Price the escape, don't just count it. (From #14. Three trades escaped the 10-bar exit and died — worth −119.90 points. Three more escaped the 20-bar stop and survived — worth +215.42 points. The count alone would have hidden which transition did the work.)
- A longer hold doesn't buy patience, it buys exposure to the stop. (From #16. At 15 it bought 3 more stops and a worse time-exit average than either end.)
- A parameter with no slope is noise — stop tuning it. (New. Three points, no monotone trend: +2,420.59 → −249.40 → +1,578.25. The middle point is the worst. There is nothing to optimise here, only a draw to admit.)
- The middle point is the test. (New, borrowed from the teardown below: if you only test the ends, you never learn whether the curve is real. Run the middle value of any parameter you think you tuned — if it doesn't land in the middle, you didn't tune anything.)
What this post gives you, and what it doesn't
This post gives you: the full exit-by-reason count at the middle hold on 4,089 daily bars (0 limit / 21 stop / 27 time), the matched-trade decomposition against both ends of the curve (−928.64 points vs 10 bars, −751.61 points vs 20 bars, on an identical 49-entry stream), the six winners that flipped to losers in five bars named with their bar-10 outcomes, the three stop deaths named, the sizing decomposition on trade #45, and the concentration check (top-5 winners 55.6% of gross profit; net ex-trade-#45 −$1,425.16).
This post does not give you: a verdict on RSI mean reversion, or a best hold — there is no best hold in this range, only three draws from the same noise. It also doesn't test whether the time exit should exist at all, or whether a trailing stop would keep the winners that the 20-bar hold kept while cutting the six that died. That is the next post, and the setup is fixed before I look at the result: same script, no limit, stop 2×ATR, no time exit — instead a trailing exit: the trail level is the highest close since entry minus 2×ATR (recomputed each bar, tracked with a var), and the trade closes when the close falls below it. If the trail keeps the winners and cuts the six, the exit was the problem all along. If it doesn't, the entry is.
Next in the series: the trailing stop — same entries, no clock, one line that follows the price instead of counting bars.
What I couldn't verify
- Costs. No commission, no slippage, same as every post in this series. The 15-bar hold trades 49 times in 16 years, so costs would bite less here than on a fast strategy — but "less" is not a number, and I haven't run it with costs.
- The sizing. All dollar figures are percent-of-equity at 100% with 2–4 contracts in this run's size range. The point totals (−928.64 vs #15, −751.61 vs #16) travel; the dollar totals don't, because the contract count follows the equity path — trade #45 entered with 2 contracts in this run vs 3 in #15, and trade #41 with one fewer than #15.
- Whether 10 is special, or 15 is just unlucky. Three points don't make a curve either — but three points with no monotone trend are enough to say the hold is not a slope in this range. The trailing-stop probe is the next post for exactly this reason: it tests a different exit mechanism, not a different number on the same clock.
- Out of sample. Same 4,089 bars as every post in the series. Nothing here has been tested on data the script hasn't already seen.
Bottom line
The middle hold was the worst of the three — net −$249.40, PF 0.967, in our testing — and the mechanism is fully accounted for: the 27 trades that survived to bar 15 lost 808.74 points against their bar-10 exits, and 3 more died to the stop for another 119.90 points, on an identical 49-entry stream. Ten bars was the lucky number, twenty was the second draw, fifteen was the worst draw — and either way the strategy is still one trade deep: without trade #45 the net is −$1,425.16. It's a breakeven strategy with a longer leash at 10 and 20 bars, and a losing one at 15. The hold isn't a parameter to tune. It's a coin flip with a stop underneath it.
Have you ever run the middle value of a parameter you "tuned" — and found it was the worst of the three? I read every comment — the middle-value stories are what the next posts are built from.
This conversion work was done by Pine2Py, the tool I build for exactly this job: paste a Pine script, get PyneCore-flavored Python back, diagnostics included when something can't be translated. The runtime is the open-source PyneCore project, with a patched build we ship for the two constructs stock PyneCore doesn't handle — details are on the site. It's free to try — every account gets 3 conversions, no card — and Pro is $12/month if you end up converting a whole library. No return promises, ever: a translator moves your logic, it doesn't make it profitable.
