A Clock Made $9,870 on the S&P 500. The RSI Made $1,029. Same Script, Same Exits.
The short version. Post #23 ended with a question one market couldn't answer: is the exit shape — ~16-bar holds, one-third wins, two-thirds of the money in five trades — a property of the exits, or of the CSI 300? Same script, same exits (2×ATR stop + trailing stop), same $10,000, same 0.1% fee, new market: 4,252 bars of S&P 500 daily, 2010–2026. In our testing:
- The RSI entry is still a coin flip. On the S&P 500 it made +$1,029.36 (29 trades, PF 1.207) — the 50th percentile of the 20-seed random-entry distribution, 0.09 standard deviations from its mean. Same verdict as the CSI 300 (55th percentile, −0.14 SD). The entry earns nothing on either market.
- The clock broke the test. The #19 clock rule — buy every 83rd bar, no price information at all — made +$9,870.59 (50 trades, PF 3.070), the 100th percentile of the same distribution, +5.37 standard deviations from the random mean. Not one of the twenty random seeds came within $6,000 of it.
- The exit shape survived — for the RSI and the dice. Not for the clock. RSI and placebo still match: ~17-bar holds, ~38% wins, ~73% of gross profit in the top five trades. The clock is a different animal: 52% wins, 20.6-bar holds, 49.8% top-five share — and it survives its biggest winner with +$7,035.77 to spare.
So the shape was never purely the exits. On a market that rose 544%, an entry that is always, evenly exposed to the drift changes the system — and a calendar that buys three days after the COVID low doesn't hurt either.
The contract: one question, chosen before I looked
23's closing line was the pre-commitment for this post, word for word: "If the shape holds there, it's the exits. If it doesn't, it was the market all along." The second market is the S&P 500, and the rules were fixed before I ran anything:
- Same script, same exits. The #22 policy-A script, byte-identical: RSI(14) crossing up through 30, 2×ATR stop from the entry average price, trailing stop at highest close minus 2×ATR, 100% of equity, market orders, policy A drop, 0.1% round-trip fee, $10,000 starting equity, patched PyneCore runtime. The compiled Python is byte-identical to #22's (verified by diff).
- New data: 4,252 bars of S&P 500 daily, 2010-01-04 to 2026-11-27 (Yahoo Finance ^GSPC). That is 163 more bars than the CSI 300's 4,089 — the US has ~252 trading days a year against China's ~242 — and the window runs three weeks longer. Not the same bar count, stated plainly, not hidden.
-
Same placebo design, re-counted. The RSI fires 35 crossover signals on the S&P 500 (not 60 — the S&P 500 crosses under 30 less often), so each placebo seed draws 35 candidate bars from bar 100 to bar 4,251, seeds 1–20,
random.Random(seed),random.sample, sorted. One signal falls before bar 100 (bar 96), the same warm-up asymmetry as #23, stated the same way. -
The clock, verbatim. #19's rule —
bar_index >= 83 and bar_index % 83 == 0— copied literally, run fee-on and fee-off. On 4,252 bars that fires 51 signals, not 35: the clock is not count-matched to the RSI on this market, and that mismatch matters — Probe 4 says how much. - One correction to #23, made here. #23 placed the CSI 300 clock (+$706.11) in the fee placebo distribution, but that clock run was actually no-fee — its script never set a commission. On the S&P 500 I ran the clock both ways, so each version lands in its matching distribution. The CSI 300 comparison below uses the no-fee clock number against the no-fee placebo distribution where it belongs.
Probe 1: the distribution — twenty dice rolls on a rising market
Closed trades only (exit Signal != 'Open'), the convention #18–#23 used. Two runs per seed: fee on (0.1% round trip) and fee off.
| Seed | Closed (fee) | Net, fee | PF, fee | Wins | Net, no fee | PF, no fee |
|---|---|---|---|---|---|---|
| 1 | 33 | −$159.23 | 0.942 | 12 / 33 | +$264.79 | 1.104 |
| 2 | 32 | +$288.12 | 1.091 | 14 / 32 | +$516.63 | 1.170 |
| 3 | 29 | +$2,000.95 | 1.677 | 10 / 29 | +$2,254.79 | 1.806 |
| 4 | 34 | +$3,173.12 | 1.999 | 16 / 34 | +$3,354.67 | 2.062 |
| 5 | 32 | +$621.58 | 1.304 | 14 / 32 | +$941.73 | 1.495 |
| 6 | 31 | −$550.88 | 0.847 | 10 / 31 | +$31.18 | 1.009 |
| 7 | 31 | +$2,432.95 | 1.909 | 13 / 31 | +$2,853.51 | 2.141 |
| 8 | 31 | +$1,032.71 | 1.461 | 12 / 31 | +$1,287.77 | 1.618 |
| 9 | 30 | −$983.79 | 0.614 | 9 / 30 | −$743.65 | 0.687 |
| 10 | 29 | +$3,362.38 | 2.177 | 13 / 29 | +$3,439.92 | 2.184 |
| 11 | 31 | +$3,047.88 | 2.184 | 13 / 31 | +$4,164.39 | 2.945 |
| 12 | 32 | −$187.67 | 0.941 | 11 / 32 | +$69.35 | 1.023 |
| 13 | 31 | +$1,581.93 | 1.581 | 13 / 31 | +$1,997.67 | 1.784 |
| 14 | 33 | +$3,483.43 | 2.037 | 16 / 33 | +$3,507.78 | 2.002 |
| 15 | 32 | −$304.69 | 0.915 | 14 / 32 | −$41.11 | 0.988 |
| 16 | 28 | +$3,673.34 | 2.452 | 9 / 28 | +$3,636.44 | 2.370 |
| 17 | 34 | +$1,919.15 | 1.685 | 18 / 34 | +$2,112.46 | 1.762 |
| 18 | 30 | −$950.68 | 0.703 | 8 / 30 | −$714.29 | 0.764 |
| 19 | 31 | +$669.72 | 1.276 | 13 / 31 | +$678.76 | 1.268 |
| 20 | 32 | −$760.69 | 0.767 | 9 / 32 | −$370.61 | 0.879 |
| Mean | 31.3 | +$1,169.48 | 1.428 | 39.3% | +$1,462.11 | 1.553 |
| Median | 31.0 | +$851.22 | 1.383 | — | +$1,114.75 | 1.557 |
| RSI baseline | 29 | +$1,029.36 | 1.207 | 37.9% | +$1,209.30 | 1.247 |
| Clock | 50 / 51 | +$9,870.59 | 3.070 | 52.0% | +$10,191.03 | 3.116 |
Three things to notice before the verdict.
First, the distribution is tighter and higher than the CSI 300's. Fee-on: mean +$1,169.48, standard deviation $1,621.21 — less than half the CSI 300 placebo's $3,514.09 — and the mean sits 3.23 standard errors from zero (the CSI 300's was 1.8). Thirteen of twenty seeds positive with the fee on, sixteen of twenty without it. Random entries on a market that rose 544% make money more often than not — the trail lets a few trades run a long way up, and the drift pays for the losers. That is a description of the market, not an edge, and it is the first thing the second market changes: the placebo mean is no longer "roughly breakeven." It is positive, and the standard error says so.
Second, the trade counts match again. Same 35 signals in, mean 31.3 entries fired (range 28–34), mean 3.7 skipped because a trade was already open — against the RSI's 30 entries and 5 skipped. Mean closed trades 31.3 vs the RSI's 29. The counts line up, and where they differ per seed, the table shows it.
Third, the fee is a small, honest tax — with one exception, again. Across the twenty seeds, removing the fee adds a median of +$254.45 (mean +$292.63), and 19 of 20 seeds improve. The exception is seed 16, where the fee version nets $36.90 more than the no-fee version — and the fee version has one fewer closed trade (28 vs 29). That is the #22/#23 mechanism again, wearing a new costume: the fee changes the equity path, the equity path changes the integer quantity, and the quantity changes which trades exist. The clock run has its own version of it — Probe 4.
Probe 2: where the RSI and the clock sit
The verdict bands, both of them, from the fee-on placebo distribution:
| Placebo distribution | RSI (+$1,029.36) | Clock (+$9,870.59) | |
|---|---|---|---|
| Percentile | — | 50th (10 / 20 seeds below) | 100th (20 / 20 below) |
| Distance from mean | mean $1,169.48, SD $1,621.21 | −0.09 SD | +5.37 SD |
| Inside IQR? | −$216.92 … +$2,586.68 | yes | no |
| Inside 1-SD band? | −$451.73 … +$2,790.69 | yes | no |
Ten of twenty random seeds beat the RSI entry on net profit. Zero beat the clock. The RSI's PF (1.207) is beaten by 12 of 20 random seeds; its win rate (37.9%) by 12 of 20. The RSI on the S&P 500 is the same non-result as on the CSI 300 — dead center of the random distribution, inside both bands, in both markets.
The no-fee picture is identical in shape:
| Placebo, no fee | RSI, no fee (+$1,209.30) | Clock, no fee (+$10,191.03) | |
|---|---|---|---|
| Percentile | — | 50th (10 / 20 below) | 100th (20 / 20 below) |
| Distance from mean | mean $1,462.11, SD $1,612.99 | −0.16 SD | +5.41 SD |
| Inside IQR? | $59.81 … +$2,978.80 | yes | no |
| Inside 1-SD band? | −$150.88 … +$3,075.09 | yes | no |
And the cross-market comparison is the cleanest result in this series so far:
| CSI 300 | S&P 500 | |
|---|---|---|
| RSI, fee | +$937.45 (47 trades, PF 1.117) | +$1,029.36 (29 trades, PF 1.207) |
| RSI percentile in its placebo distribution | 55th, −0.14 SD | 50th, −0.09 SD |
| Clock, no fee | +$706.11 (48 trades, PF 1.092) | +$10,191.03 (51 trades, PF 3.116) |
| Clock percentile in its placebo distribution | 50th, −0.31 SD (no-fee vs no-fee) | 100th, +5.41 SD |
The RSI is median-random on both markets — its net differs by $91.91 across two very different markets, which is itself a kind of stability: the entry consistently contributes nothing. The clock moved from ordinary to extraordinary when the market changed. Same rule, same exits, same fee. The market did it.
Probe 3: the fee doesn't move the verdict
Same test, no fee. The no-fee placebo distribution: mean +$1,462.11, SD $1,612.99, median +$1,114.75, Q1 $59.81, Q3 +$2,978.80, IQR $2,918.99, range −$743.65 to +$4,164.39. Sixteen of twenty seeds positive — the fee-off world is friendlier, as it should be, because the fee is a tax on every round trip and nothing else.
| Placebo, no fee | RSI, no fee (+$1,209.30) | Clock, no fee (+$10,191.03) | |
|---|---|---|---|
| Percentile | — | 50th (10 / 20 below) | 100th (20 / 20 below) |
| Distance from mean | mean $1,462.11, SD $1,612.99 | −0.16 SD | +5.41 SD |
| Inside IQR? | $59.81 … +$2,978.80 | yes | no |
| Inside 1-SD band? | −$150.88 … +$3,075.09 | yes | no |
Ten of twenty random seeds beat the RSI without the fee; twelve beat its PF of 1.247. Zero beat the clock on either measure. The fee changes the numbers; it doesn't change either answer. That is what a control is for, and this one held twice: the RSI is median-random with or without the fee, and the clock is off the chart with or without it.
One more fee detail, because the mechanism keeps showing up. Seed 16 is the one seed where the fee version beats the no-fee version (+$3,673.34 vs +$3,636.44) — with one fewer closed trade (28 vs 29). The fee, through the equity path, changed the integer quantity on some trade, and the trade that existed in the no-fee run didn't exist in the fee run. The clock run has the same story in reverse, and it is worth its own paragraph — Probe 4.
Probe 4: the clock — anatomy of a calendar accident that isn't one
The clock's headline (+$9,870.59 fee, +$10,191.03 no-fee, PF 3.070 / 3.116) deserves an autopsy, because a 5.37-SD result from a rule with no price information is either a discovery or a counting trick. Start with the five trades that made it:
| Trade | Entry | Exit | Hold | Profit |
|---|---|---|---|---|
| #30 | 2020-03-26 @ 2,501.29 | 2020-06-12 @ 3,071.04, trail | 54 bars | +$2,834.82 |
| #2 | 2010-09-01 @ 1,049.72 | 2010-11-16 @ 1,194.79, trail | 53 bars | +$1,295.53 |
| #41 | 2023-11-09 @ 4,391.41 | 2024-01-04 @ 4,697.42, trail | 37 bars | +$1,205.86 |
| #37 | 2022-07-18 @ 3,883.79 | 2022-08-23 @ 4,133.09, trail | 26 bars | +$981.17 |
| #39 | 2023-03-15 @ 3,876.74 | 2023-04-27 @ 4,075.29, trail | 30 bars | +$972.87 |
Trade #30 is the calendar accident, stated plainly: the S&P 500 bottomed on 2020-03-23 (close 2,237.40, −33.9% from the February high), and the clock's 31st tick — bar 2,573, every 83rd bar from 83 — bought three days later at 2,501.29 and rode the recovery to 3,071.04 over 54 bars. It is 28.7% of the clock's net. If that is all the clock is, removing it should kill the result. It doesn't: net minus biggest winner is +$7,035.77, still 6.8× the RSI's net and still above every placebo seed's total net. The accident is real, and the result survives it.
What survives it is structural, and it shows up in three numbers. First, time in the market: the clock's 50 trades × 20.6 bars = 1,030 bars in the market, 24.2% of the window — against the RSI's 511 bars (12.0%) and the placebo mean's 508 (11.9%). The clock is exposed to the drift twice as often, because it never clusters and never leaves a multi-year gap: every 83 bars, without fail, it buys. Second, per-trade expectancy: +$197.41 per closed trade, against the RSI's +$35.50 and the placebo mean's +$37.37 — five times higher, so this is not just "more trades." The clock's entries land mid-trend, where the trailing stop has room to work; the RSI's entries land after selloffs, where the next bars are as likely to hit the stop as to run. Third, win rate: 52.0% of closed trades win (26/50), against the RSI's 37.9% and the placebo mean's 39.3% — and the winners hold 30.8 bars on average against the losers' 9.5. The trail, given entries that aren't bought into falling knives, does what a trail is supposed to do.
The clock also carries its own policy-A story, and it runs in the opposite direction from #23's seed 20. The fee run has 50 trades; the no-fee run has 51. The missing one is signal bar 2,241 (2018-11-27, close 2,682.17, fill open 2,691.45):
- Fee run: equity at the signal $13,422.51. 100% of equity sizes 5 contracts (13,422.51 / 2,682.17 = 5.00 → 5). Five at the fill open cost $13,457.25. Equity is $13,422.51. Short $34.74. Policy A drops the order, silently. The trade never exists.
- No-fee run: equity at the signal $13,597.40 — $174.89 higher, because it never paid the fee. Same 5 contracts, same $13,457.25 fill cost. It fits. The trade exists: entry 2018-11-28, exit 2018-12-06 on the trail, −$139.70.
In #23, being poorer gained a trade; here, being poorer lost one — and losing it saved $139.70, since the trade was a loser. The fee run still nets $320.44 less overall ($670.91 of fees paid, partly offset by the saved loss and quantity knock-ons). The lesson is the same from both directions: under the drop policy, $35 of equity at the wrong bar decides whether a trade exists at all, and which side of the boundary you're on is luck. Anyone who reports a backtest without stating the fill policy is reporting one draw from this lottery.
One more comparison, because it frames the whole post: buy and hold on the same data turns $10,000 into $64,409.13 (+544.1%). The clock's +$9,870.59, the RSI's +$1,029.36, the placebo mean's +$1,169.48 — all of them are far below doing nothing. The clock is extraordinary among trading rules on these exits. It is not extraordinary among ways to own the S&P 500 for seventeen years. Both sentences are true, and the second one is the one that matters if you're choosing what to do with money.
Probe 5: what the exits do alone — and where the shape breaks
Strip the entry out and the system keeps its shape — for the RSI and the dice. The clock breaks it.
| Placebo mean | RSI baseline | Clock | |
|---|---|---|---|
| Avg hold (fee) | 16.23 bars | 17.62 bars | 20.60 bars |
| Win rate (fee) | 39.3% | 37.9% | 52.0% |
| Trail / stop exit mix (fee) | 68.9% trail | 69.0% trail (20 / 29) | 76.0% trail (38 / 50) |
| Top-5 winners' share of gross profit (fee) | 74.7% | 73.1% | 49.8% |
| Surviving the biggest winner (fee) | 10 / 20 seeds | no (−$13.96) | yes (+$7,035.77) |
| Median net − biggest winner (fee) | +$27.07 | −$13.96 | — |
| PF (fee) | 1.428 | 1.207 | 3.070 |
The no-fee table says the same thing: placebo mean 16.28-bar holds, 40.1% wins, 73.5% top-five share; RSI 17.62 bars, 37.9% wins, 72.7% top-five; clock 20.29 bars, 54.9% wins, 49.1% top-five, net minus biggest +$7,342.28.
So #23's conclusion needs a revision, and this post is the revision: the exit shape is real, but it is not purely the exits. On the CSI 300, every entry — RSI, clock, dice — produced the same animal, and I called the shape a property of the exits. On the S&P 500, the RSI and the dice still produce that animal, and the clock doesn't. The difference is the entry's relationship to the market's drift: an entry that fires after selloffs (RSI) or uniformly at random (placebo) spends ~12% of the window in the market and lets the trail work on whatever it catches; an entry that fires on a fixed schedule, never clustering, never gapping, spends 24% of the window in the market on a market that rose 544% — and the trail, given twice the exposure to a rising drift, produces longer holds, more wins, and a flatter profit distribution. The exits set the form of the system (trail-heavy, fat-tailed, concentrated). The entry — or rather, the entry's exposure to the drift — sets how much of the market's rise the form gets to eat.
That reframes the question #23 left open. It is not "is the edge in the entry or the exits." It is: how much of any entry's result is the market's drift, metered through time in the market? The RSI's answer on two markets is "none you can distinguish from noise." The clock's answer on the S&P 500 is "a lot — but only because the market rose, and only because the clock never stopped buying it." Whether that is an edge or a property of a rising market is the next test, and it needs an entry that is evenly spaced and count-matched — because this clock had 51 signals against the RSI's 35, and I can't yet separate "even spacing" from "more trades."
How I checked the numbers
The RSI baseline, one trade, by hand against the trade file and the raw feed — the method, so anyone can repeat it:
- Trade 1 (entry bar 97, exit 107, trail): signal bar 96 is an RSI cross-up (RSI 29.80 → 34.89, recomputed Wilder RSI(14) from the feed matches the plotted RSI on all 4,238 comparable bars, zero mismatches); entry price 1,084.78 equals the feed open of bar 97; recomputing the trailing level from closes and Wilder ATR(14), the first close below the trail falls on bar 106 — exit bar minus one, exactly as a close-triggered exit filling at the next open should; profit −$315.34 recomputed from the two prices, 9 contracts, and 0.05% per side — exact to the cent.
- The clock's trade 1 (entry bar 84, exit 85, stop): signal bar 83 is in the clock list; entry price 1,169.24 equals the feed open of bar 84; the exit price 1,137.20 is not the open of bar 85 (1,164.38) — it is the resting stop, entry average minus 2×ATR of bar 84 (1,169.24 − 2×16.02 = 1,137.20), breached intrabar on bar 85 (low 1,065.79); profit −$265.55 recomputed exact. A one-bar stop-out, and the stop arithmetic is the check that it filled at the stop, not at the open.
- The dropped clock trade (signal 2,241): fee-run equity $13,422.51 → 5 contracts → fill cost $13,457.25, short $34.74, dropped; no-fee equity $13,597.40 → same 5 contracts, fits, trade exists and loses −$139.70. Both equities recomputed from the cumulative-profit column of the trade file.
- Counts. All 30 RSI entries trace to signal bars (signal bar = entry bar − 1); 5 of the 35 signals were skipped because a trade was already open (bars 405, 1518, 2222, 3209, 3822 — each one adjacent to a fired signal: 403/405, 1515/1518, 2219/2222, 3206/3209, 3820/3822). The RSI's last trade (#30, entry bar 4,249 on 2026-11-24 @ 7,172.33, 1 contract) is still open at the final bar and is excluded from every closed-trade number above. All 40 placebo runs compiled with zero diagnostics; the fee/no-fee .py diff is title + commission_value only (verified on seed 1 and the clock).
What I couldn't verify
- The clock is not count-matched. 51 clock signals against 35 RSI signals on this market. Part of the clock's edge is mechanical — more trades, more time in the market (24.2% vs 12.0%) — and I can't separate that from even spacing yet. The count-matched clock (every ~121st bar, 35 signals) is the obvious next run and isn't run yet.
- The windows aren't identical. 4,252 S&P 500 bars vs 4,089 CSI 300 bars; the S&P 500 window runs to 2026-11-27, the CSI 300 to 2026-11-06. Different vendors, too (Yahoo Finance vs Sina), and one S&P 500 bar (2023-05-24) carries a zero volume that Yahoo reports and the strategy ignores. None of that changes the verdict bands, but the two markets were never the same experiment twice.
- 20 seeds, not 50. Twenty draws pin the RSI to the middle of the distribution, but the tails are thin: the 50th percentile of 20 seeds is a coarse estimate. Fifty seeds would tighten it; the verdict (inside both bands) would need a large move to change. The clock at +5.37 SD does not need tighter tails.
- Uniform random bars are not a realistic null. Real entries cluster — RSI signals cluster on selloff days (five of the S&P 500's skipped signals sit next to fired ones). The placebo draws uniformly, so it doesn't test "entry timing within selloffs" — only "entry timing, period." A clustered placebo (random bars drawn only from down days) is a sharper null and isn't run yet.
- The exits are untested as an edge. The placebo says the entry adds nothing given these exits. It doesn't say the exits have an edge — the mean random entry is 3.23 standard errors from zero on this market, but that is the drift talking, and buy-and-hold beats even the clock by more than 6×.
- One fee level, one sizing rule. All fee-on runs carry the same 0.1% round trip and 100%-of-equity sizing. The $34.74 quantity-boundary drop is a property of that sizing rule; a fixed fractional size would move the boundary.
Bottom line
Two markets, same verdict on the entry, opposite verdicts on the clock. The RSI crossover is median-random on the CSI 300 (55th percentile) and median-random on the S&P 500 (50th percentile, −0.09 SD) — the entry that this whole series was built around contributes nothing you can measure, twice. The clock was median-random on the CSI 300 (+$706.11, 50th percentile) and 5.37 standard deviations above random on the S&P 500 (+$9,870.59, PF 3.070) — the same rule, the same exits, a different market. The difference is exposure to a market that rose 544%: even spacing, twice the time in the market, entries that land mid-trend instead of after selloffs. The exits set the form; the market's drift, metered through time in the market, sets how much the form gets to eat. And none of it — not the RSI, not the dice, not the clock — comes close to buying the index and doing nothing, which turned $10,000 into $64,409.13 over the same window.
Next post (#25): the count-matched clock — every 121st bar, 35 signals, the same count as the RSI stream — to separate "even spacing" from "more trades." If it keeps the edge, spacing is doing the work. If it falls back to the middle of the distribution, the clock's win was mostly a trade-count effect, and the story changes again.
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-11-30, in our testing: 1,909 real-world scripts compile at 99.7% and fully translate at 98.4%.
Top comments (0)