I Let the Dice Pick the Day Inside the Oversold Stretch. All 50 Beat the RSI.

The short version. #29 ended with a promise: Alice's timing placebo — same RSI oversold stretches, same 29 trades, one random day drawn inside each stretch. I ran it: 50 seeds, same script, same exits, same $10,000, same 4,252 bars. In our testing:

  • The dice bought a random day inside each stretch — and beat the RSI 50 times out of 50. The timing median is +$5,439.18 (fee), against the RSI's +$1,029.36. The RSI sits at the 0th percentile of its own timing distribution. The worst seed (+$1,818.42) still beats it by $789.06.
  • The turn day is the bounce. Signal days rise +2.04% open-to-close on average (27 of 29 up), against +0.03% on an average day. The RSI buys the morning after the turn day; the dice buy the morning of it. Waiting costs +1.55% per trade on average — about $155 a trade on $10,000, which is the scale of the whole $4,409.82 gap.
  • The clock survives its fourth null. #24's clock (+$9,870.59) sits at the 100th percentile, +3.06 SD — the closest any null has come (uniform +5.37, clustered +7.27, shuffle +3.45).

This is the thirtieth post in a series where I convert classic Pine strategies to Python line by line. The last post shuffled the RSI's exits and found them at the 14th percentile. This one shuffles only the entry day, inside the RSI's own oversold stretches.

The distinction: the stretch vs the turn

One distinction governs this whole post, so it goes first.

The RSI rule buys the turn: the day RSI crosses back up through 30. The stretch is everything before it — the consecutive days RSI spent below 30. The turn is one day; the stretch is the days that earned it.

The placebo buys a random day inside the stretch. It does not wait for the turn. It is in the market, somewhere in the fall, when the turn arrives. Everything after this paragraph is measuring that one distinction: does the turn itself do the work, or does being in the stretch do it?

What stays fixed, what changes

RSI Timing placebo
Oversold stretches The RSI's own 29 The same 29
Entry day The cross day (first RSI ≥ 30) One random day inside the stretch
Fill Next bar's open, sized at the signal close Same rule
Exits 2×ATR stop + trailing stop Same
Sizing, fees 100% of equity, 0.1% round-trip Same
Data S&P 500 daily, 4,252 bars, 2010–2026 Same
Closed trades 29 Median 27

The naive version of this placebo would draw any day RSI is below 40, the way #28's clustered dice did. That version changes three things at once — timing, trade count, and which stretches get sampled — so whatever it finds, you cannot tell which change did it. Alice's version, from #28's comments, changes one thing: the day inside the stretch. That is the whole design.

The contract: two questions, chosen before I looked

The first is #29's closing promise, word for word: "Alice's within-stretch timing placebo — same RSI oversold stretches, same 29 trades, one random day drawn inside each stretch. The question is whether the turn itself, not the stretch, is doing the work."

The second is the design's own pre-registered expectation: if waiting for the turn has an edge, the RSI should sit high in the timing distribution and the median should sit clearly below it. If the edge is in stretch selection instead, the RSI should sit in the middle.

The design was locked before I ran anything (design file written 2026-12-06, 19:xx, before the first run). The stretches were computed before generating: 29 stretches, 58 bars in total, median length 2, longest 5. Fourteen of the 29 are length 1 — a single day, so the draw is forced: buy the day before the turn, fill at the turn day's open, one bar before the RSI fills. The randomization only bites on the other 15. This placebo is a narrow null, and that narrowness is part of the result, not a footnote to it.

Two details matter most. First, the in-trade gate stays: a drawn day that falls while a trade is open is skipped, not re-drawn — so each seed takes a median of 27 trades, not 29. Second, the fill is at the drawn day's open the next bar, not the drawn day's close — the same fill rule as the baseline, so no look-ahead sneaks in through the entry price.

Probe 1: the distribution

Timing distribution (fee) RSI Clock #24
Net Median +$5,439.18 (mean $5,127.14, SD $1,550.48) +$1,029.36 +$9,870.59
Range +$1,818.42 … +$8,179.69 (Q1 $5,147.22, Q3 $6,019.25) — —
Percentile — 0th (50/50 beat it) 100th (0/50 beat it)
Z-score — −2.64 +3.06

No-fee: median +$5,627.02 (mean $5,668.95, SD $1,511.82, range +$1,842.07…+$8,729.88). RSI +$1,209.30 at the 0th percentile (50/50, z=−2.95). Clock +$10,191.03 at the 100th (0/50, z=+2.99).

Read the fee table literally: the RSI is not "below average." It is below every seed. The distribution's floor is $789 above the RSI. And the clock is at the top for the fourth time — but this is the closest any null has come, +3.06 SD against +3.45 for the shuffle. The nulls are getting harder, and the clock is still standing.

Probe 2: per bar in the market, the cross-distribution yardstick

Distribution Median net per bar in market (fee)
Timing (this post) +$10.12
Exit-shuffle (#29) +$7.26
Duration-control (#29) +$4.70
RSI +$2.01
Uniform placebo (#27) +$1.71
Clustered placebo (#28) −$7.98

Six distributions, one yardstick, one ordering: the timing dice sit at the top, the clustered dice at the bottom, and the RSI in the middle — above the uniform dice, below its own shuffled exits, and now below its own shuffled entry days too. The yardstick matters because the distributions take different numbers of trades over different numbers of bars; per-bar is the only comparison that does not mix a count effect into the verdict.

Probe 3: the counts

Per seed (fee, median): 29 draws → 28 attempted → 1 skipped → 0 dropped → 27 taken → 27 closed. Skipped means the drawn day fell while a trade was open (the gate, not a bug). Dropped means policy A rejected the fill — the quantity sized at the signal close cost more than the account at the fill bar's open. The count is close enough to the RSI's 29 that the median gap is not a trade-count artifact the way #28's was.

Probe 4: early vs late inside the stretch

Split every closed trade by its normalized position in the stretch — 0 for the first day, 1 for the last. Early half (p < 0.5): mean +$311.81 per trade (n=339). Late half (p ≥ 0.5): mean +$148.87 (n=1,012). But the late half is contaminated: it holds all 14 forced length-1 draws, which sit at p=1 by definition. Restrict to stretches with length ≥ 2, where the draw is genuinely random: early +$311.81 (n=339) vs late +$396.19 (n=384). Buying closer to the turn is somewhat better — but the early half is positive too. The money is not in picking the exact turn day. It is in being in the stretch before the turn happens.

Probe 5: strip the biggest winner

Remove each seed's biggest winner and recompute: the fee median is still +$2,864.23 (no-fee +$3,115.98), against the RSI's −$13.95 once its own biggest winner is removed. The RSI without its best trade is underwater. The median dice without its best trade is still nearly triple the RSI with its best trade. This result does not ride on one trade.

Why the dice win — the turn day is the bounce

The distribution says the RSI loses. This section says why, with three numbers.

First, the turn day is the bounce. The 29 signal days rise +2.04% open-to-close on average (median +1.50%, 27 of 29 up). The average day on this data rises +0.03%. The stretch days, by contrast, fall −1.62% on average (5 of 58 up). The stretch is the fall; the turn day is the bounce. That is not a surprise — RSI crossing 30 requires a strong up day — but the size of it is the point: the confirmation the RSI waits for is itself the move.

Second, the confirmation has a price. The RSI fills at the open of the day after the turn. The dice fill at the turn day's open in 891 of 1,351 fills (66%), or earlier in the rest. The day-after open runs on average +1.55% above the turn-day open (median +1.34%). At 100% equity on $10,000, that is about $155 a trade; across 29 trades, about $4,495 — the same scale as the $4,409.82 median gap. That is arithmetic, not proof — the exits shift too — but it sets the size of the effect: the gap is what waiting costs, not what timing earns.

Third, the stop is anchored to the entry. A lower entry means a lower stop (entry average price − 2×ATR), so the same pullback is less likely to trigger it. Seed 1, stretch 12: the RSI's trade is stopped out after 3 bars (−$283.03); the dice's trade on the same stretch rides 64 bars (+$400.40). It cuts the other way too — stretch 15: the RSI makes +$857.11 over 48 bars while the dice are stopped after 2 (−$479.83) — but across all seeds the balance favors the dice: the median seed turns 3 of the RSI's losing trades positive (range 1–4) and only 1 winning trade negative (range 0–1).

The killer stat for the autopsy is the fill-price advantage: the dice fill on average 1.00% cheaper than the RSI (median −0.85%), cheaper in 1,088 of 1,450 draws. One percent a trade, twenty-seven trades, same exits. That is the whole story in one number.

How I checked the numbers

The checks, so anyone can repeat them:

  • The RSI series, recomputed. Wilder RSI(14) from the closes matches the #24 baseline run's RSI column to 0.0000, and the 35 cross-ups through 30 are exactly the published 35. The 29 stretches were enumerated from that verified series, not from the trade files.
  • The entry bars, aligned. Every filled trade's entry bar equals its drawn bar + 1 — checked by the analyzer across all 100 runs. A signal on the previous trade's exit bar is not blocked (the close executes at that bar's close), the same occupancy rule #29 proved.
  • Seed 1, in full. Drawn bars 95, 402, 597, 609, 722, 1205, 1419, 1514, 1521, 1722, 2036, 2039, 2069, 2211, 2218, 2256, 2368, 2412, 2553, 2561, 2564, 3034, 3203, 3460, 3478, 3819, 3839, 4077, 4083; fee net +$5,428.14 on 27 closed trades (attempted 28, skipped 1, dropped 1). The full manifest is in timing_manifest.json.
  • Medians recomputed by hand. Fee: the 25th and 26th of 50 sorted nets average to +$5,439.18, matching the analyzer. RSI positions: 0 of 50 fee nets below +$1,029.36 (0.0%); 0 of 50 no-fee nets below +$1,209.30. Z-scores: (1,029.36 − 5,127.14) / 1,550.48 = −2.64; (9,870.59 − 5,127.14) / 1,550.48 = +3.06.
  • The strat-file check. Seed 1's strat "All" net equals the trades-file net exactly ($5,428.14) — that seed has no open trade, so the entry-commission gap #29 found does not appear. All nets in this post are trades-file closed nets, the series convention since #22.
  • Trade 25, the RSI's biggest winner. Its stretch is length 1, so the draw is forced: 49 of 50 seeds take it, median +$1,107.22 against the RSI's +$1,043.31, and 49 seeds beat the RSI on it — because the forced fill at the turn day's open catches the whole bounce day.

What this test does not prove

  • The placebo is not a tradable rule. The stretch boundaries are known only in hindsight: the placebo always catches the turn, because the turn is defined as the end of the stretch. It diagnoses what waiting for confirmation costs. It does not hand you an entry rule — "buy a random day in a stretch" is not a strategy, it is a null.
  • The null is narrow. Fourteen of 29 stretches are length 1, so the randomization only bites on 15. On a different market, or a different oversold threshold, the stretches would be longer and the dice would have more room to differ — in either direction.
  • One market, one window. Everything here is the S&P 500, 2010–2026, a market that rose 544% (buy-and-hold +$54,409 on the same $10,000). The drift is doing work in every number in this series, including the dice's — all 50 seeds positive is partly a rising market, not a property of random days.
  • The exits are not re-litigated here. This post keeps the RSI's exits (2×ATR stop + trailing). #29 already showed those exits are the weak half; the timing result does not change that, and a different exit family would draw a different distribution.
  • The clock is not "proven good." Four nulls have not killed it, and the fourth got closer than the first three. That is a statement about the nulls, not about the clock. The ratchet test and the seed raise to 300 are the tests that could still kill it, and they have not been run.
  • The early/late split is a mean over trades, not a controlled comparison. The same stretch's early and late draws live in different seeds, and the length ≥ 2 cut has only 339 vs 384 trades. It says "closer to the turn is somewhat better," not "buy late."

Bottom line

23 said the RSI entry was decoration. #28 said the entry timing matters — 82nd percentile against clustered dice. #29 said the exits are the weak half. #30 says the confirmation itself is the cost: against dice that keep the RSI's stretches and shuffle only the day inside them, the RSI lands at the 0th percentile, and the gap is the size of the turn day the RSI waits out. The rule that survives is not "wait for the turn." It is "be in the stretch before the turn — and know that the turn day is the bounce, so the morning after it is the most expensive morning to buy." And the clock survived its hardest null yet — 100th percentile, +3.06 SD, the closest any null has come — which means the next test has to stop shuffling the RSI's parts and start varying the clock's exits: the ratchet test is next.

Next post (#31): the ratchet test — per-trade reset, re-ratchet, fixed half-ATR, same ATR series. The question is whether the trailing stop's ratchet, not the entry, is what the clock is standing on.

Disclosure: I built Pine2Py (pine2py.com), the Pine Script → Python converter this series runs on. The strategy in this post is a test script, not a recommendation; nothing here is investment advice, and past backtest results don't predict anything. Free accounts get 3 conversions total; Pro is $12/month via Paddle. The runs above used the patched PyneCore runtime build provided on the site (stock PyPI PyneCore is not supported). All numbers are from local runs on 2026-12-06, in our testing: 1,909 real-world scripts compile at 99.7% and fully translate at 98.4%.