I Shifted the Clock by 41 Bars. It Lost $4,260 — and Still Beat Every Random Entry.
The short version. #25 ended with a question: the 83-bar clock that made $9,870.59 on the S&P 500 — was its win the even spacing, or did that particular grid just happen to buy three days after the COVID low? Same script, same exits (2×ATR stop + trailing stop), same $10,000, same 0.1% fee, same 4,252 bars, new rule: buy every 83rd bar, offset by 41 bars — exactly 51 signals, the same count as #24's clock. In our testing:
- The shifted clock fell by $4,260 — and still beat every random entry. It made +$5,610.10 (51 trades, PF 2.137) — the 100th percentile of the same 20-seed random-entry distribution, +2.74 standard deviations from its mean. Zero of twenty seeds beat it, with or without the fee.
- The gap is all spacing, no count effect at all. The 83-bar clock beat it by $4,260.49. Of that gap, −$197.41 (−4.6%) is the count effect — the shifted clock actually closed one more trade — and $4,457.90 (104.6%) is the per-trade expectancy collapse, $197.41 down to $110.00. Same spacing, same trade count, half a period apart: $4,260 apart.
- Phase decides how much, not whether. The COVID-low trade is gone: the shifted grid bought a month before the crash (−$58.97) and next bought halfway up the recovery (+$255.69). But take the shifted clock's biggest winner away and it still beats all twenty random seeds — +$4,402.65 against a best placebo of +$2,026. The grid itself has something; the phase decides how much of it you keep.
The contract: one question, chosen before I looked
25's closing line was the pre-commitment for this post, word for word: "the phase-shifted clock — same 83-bar spacing, offset by 41 bars, 51 signals — to separate 'even spacing' from 'this particular grid happened to buy the COVID low.' If the shifted grid also wins, spacing is doing the work. If it falls back to the middle, the 83-bar clock's win was one lucky phase, and the story changes again." The rules were fixed before I ran anything — and the offset was fixed before that, in #25's closing line, not picked after seeing #24's result:
- Same script, same exits. The #22 policy-A script, entry swapped only:
longSignal = bar_index >= 41 and bar_index % 83 == 41, 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. Both scripts compiled with zero diagnostics; the fee/no-fee compiled Python differs in title + commission_value only. - 41 is the half-period shift, computed before the run, not fitted after it. 83 / 2 = 41.5, rounded down to 41. On 4,252 bars the rule fires exactly 51 signals (41, 124, …, 4,191) — the same count as #24's clock, verified from the signal list before running, not from the trade file after.
- Same data, same placebo. 4,252 bars of S&P 500 daily, 2010-01-04 to 2026-11-27 (Yahoo Finance ^GSPC), the same file #24 used. The placebo distribution is #24's twenty seeds, recomputed from #24's forty trade files — the numbers match #24's published distribution exactly (fee mean +$1,169.48, SD $1,621.21; no-fee mean +$1,462.11, SD $1,612.99), so the verdict bands are the same ones.
- Fee on and fee off, both. Each version lands in its matching distribution, the #24 correction applied from the start.
One note on method, borrowed from a post I read this week: botgauntlet's rule is to lock the criteria before you look — write the hypothesis, the data, the metric and the pass/fail thresholds down, hash them, and get one run with no tweaking after. I can't hash a dev.to closing line, but #25's closing line is the same device in public: the offset, the signal count and the fork ("if it also wins, spacing is doing the work; if it falls back, it was one lucky phase") were all printed before this run existed. This post is the run the fork promised.
Probe 1: the distribution — the same twenty dice rolls
Closed trades only (exit Signal != 'Open'), the convention #18–#25 used. The full twenty-seed table is #24's Probe 1, unchanged; the summary bands the verdict rests on:
| Placebo, fee | Placebo, no fee | |
|---|---|---|
| Mean | +$1,169.48 | +$1,462.11 |
| SD | $1,621.21 | $1,612.99 |
| Median | +$851.22 | +$1,114.75 |
| Q1 … Q3 | −$216.92 … +$2,586.68 | $59.81 … +$2,978.80 |
| 1-SD band | −$451.73 … +$2,790.69 | −$150.88 … +$3,075.09 |
| Range | −$983.79 … +$3,673.34 | −$743.65 … +$4,164.39 |
| Positive seeds | 13 / 20 | 16 / 20 |
Against those bands, the four entries on the same market:
| Signals | Closed | Net, fee | PF, fee | Net, no fee | PF, no fee | |
|---|---|---|---|---|---|---|
| RSI baseline | 35 | 29 | +$1,029.36 | 1.207 | +$1,209.30 | 1.247 |
| Clock #24 (every 83rd) | 51 | 50 / 51 | +$9,870.59 | 3.070 | +$10,191.03 | 3.116 |
| Count-matched clock #25 (every 121st) | 35 | 35 / 35 | +$2,719.03 | 2.010 | +$2,942.48 | 2.112 |
| Phase-shifted clock #26 (every 83rd, +41) | 51 | 51 / 51 | +$5,610.10 | 2.137 | +$6,089.27 | 2.236 |
One detail before the verdict: the shifted clock fired all 51 signals in both runs — no skipped signals, no policy-A drops, no trade still open at the final bar. Every entry bar in the trade files equals its signal bar + 1, first signal 41 → entry bar 42, last signal 4,191 → entry bar 4,192. The strategy file's net profit equals the closed-trade net exactly ($5,610.10 fee, $6,089.27 no-fee), because there is no open trade to reconcile. The fee drag is $479.17; the fee run paid $577.08 in commission across 51 trades.
Probe 2: where the phase-shifted clock sits
The verdict bands, both of them, from the fee-on placebo distribution:
| Placebo distribution | RSI (+$1,029.36) | Clock #24 (+$9,870.59) | EC clock #25 (+$2,719.03) | PS clock #26 (+$5,610.10) | |
|---|---|---|---|---|---|
| Percentile | — | 50th (10 / 20 below) | 100th (20 / 20 below) | 75th (15 / 20 below) | 100th (20 / 20 below) |
| Distance from mean | mean $1,169.48, SD $1,621.21 | −0.09 SD | +5.37 SD | +0.96 SD | +2.74 SD |
| Inside IQR? | −$216.92 … +$2,586.68 | yes | no | no (above Q3 by $132.35) | no (above Q3 by $3,023.42) |
| Inside 1-SD band? | −$451.73 … +$2,790.69 | yes | no | yes | no (above band by $2,819.41) |
The no-fee picture is the same shape:
| Placebo, no fee | RSI, no fee (+$1,209.30) | Clock #24, no fee (+$10,191.03) | EC clock #25, no fee (+$2,942.48) | PS clock #26, no fee (+$6,089.27) | |
|---|---|---|---|---|---|
| Percentile | — | 50th (10 / 20 below) | 100th (20 / 20 below) | 75th (15 / 20 below) | 100th (20 / 20 below) |
| Distance from mean | mean $1,462.11, SD $1,612.99 | −0.16 SD | +5.41 SD | +0.92 SD | +2.87 SD |
| Inside IQR? | $59.81 … +$2,978.80 | yes | no | yes | no (above Q3 by $3,110.47) |
| Inside 1-SD band? | −$150.88 … +$3,075.09 | yes | no | yes | no (above band by $3,014.18) |
So #25's fork resolves against its second branch: the shifted grid did not fall back to the middle. It sits at the 100th percentile, +2.74 SD, outside both bands, on both fee settings. The 83-bar clock's win was not one lucky phase. But the fork's first branch needs a correction too: "spacing is doing the work" is too strong. Spacing is doing some of the work — the shifted grid still beats every die roll — and phase is doing the rest, $4,260 of it. The honest reading of the fork is the middle one: the grid has something, and the phase decides how much.
Probe 3: the gap is all spacing
The decomposition, fee-on first:
| Clock #24 | PS clock #26 | Gap | |
|---|---|---|---|
| Net, fee | +$9,870.59 | +$5,610.10 | $4,260.49 |
| Closed trades | 50 | 51 | −1 |
| Expectancy per trade | $197.41 | $110.00 | $87.41 |
| Count effect (1 more trade × clock expectancy) | — | — | −$197.41 (−4.6%) |
| Spacing effect (51 PS trades × expectancy change) | — | — | $4,457.90 (104.6%) |
The no-fee split says the same thing, cleaner: gap $4,101.76, count effect $0.00 (0.0%, both clocks closed 51), spacing effect $4,101.76 (100.0%). There is no count story left to tell here — both grids fired 51 signals and closed 51 trades. The entire $4,260 is that each trade on the shifted grid earned $87.41 less on average. One honest caveat, stated now rather than buried: this decomposition is arithmetic, not causal. It separates "fewer trades" from "each trade earned less," but the spacing half is itself two things I haven't separated yet: the 83-bar spacing, and this particular grid's phase luck. The next post is built to start separating them — a phase curve, not another single phase.
Buy and hold, for scale, as in #24 and #25: $10,000 into the index over the same window becomes $64,409.13 (+544.1%). The phase-shifted clock's +$5,610.10, the 83-bar clock's +$9,870.59, the count-matched clock's +$2,719.03, the RSI's +$1,029.36 — all far below doing nothing. The shifted clock is the best trading rule on these exits after #24's clock. It is not above average 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 4: anatomy of the missing COVID trade
The gap has a face, and it is one trade. #24's clock bought three days after the COVID low: signal 2,573, entry bar 2,574, 2020-03-26 @ 2,501.29, trail exit 2020-06-12 @ 3,071.04, +$2,834.82 — 28.7% of that clock's entire net in a single trade. The shifted grid has no signal anywhere near bar 2,573. Its two nearest trades bracket the crash from the wrong sides:
| Signal | Entry | Exit | Result | |
|---|---|---|---|---|
| PS trade #31 | 2,531 | 2020-01-27 @ 3,247.16 | 2020-02-03 @ 3,235.66 (trail) | −$58.97 |
| #24 clock trade #30 | 2,573 | 2020-03-26 @ 2,501.29 | 2020-06-12 @ 3,071.04 (trail) | +$2,834.82 |
| PS trade #32 | 2,614 | 2020-05-26 @ 3,004.08 | 2020-06-12 @ 3,071.04 (trail) | +$255.69 |
The shifted grid bought a month before the crash and was stopped out for −$58.97, then bought again on 2020-05-26, after half the recovery had already happened, and exited on the very same bar the clock's COVID trade exited — 2020-06-12 @ 3,071.04 — for +$255.69. The swap itself accounts for $2,638.10 of the $4,260.49 gap (61.9%): the $2,834.82 trade the grid missed, minus the $196.72 its two replacement trades made. Two-thirds of the gap is one phase-lucky trade, present in one grid and absent in the other. The remaining third — about $1,622 — is the same story spread thinner across the other fifty trades: the shifted grid's expectancy is lower almost everywhere, not just in March 2020.
There is a second lesson hiding in that table, and it cuts the other way. The shifted grid missed the best trade in the whole series and still beat every random seed by more than $1,900. If the 83-bar clock's win were only the COVID trade, the shifted grid would have fallen to the middle with the count-matched clock. It didn't. Whatever the grid is doing — buying every 83rd bar with a 2×ATR trailing exit on a market that rose 544% — survives losing its best trade. That is the result I didn't expect when I wrote #25's fork.
Probe 5: take the biggest winner away
Botgauntlet's third check, applied literally: check the result without its best days. The shifted clock's biggest winner is trade #19 — entry 2016-02-10 @ 1,857.10, trail exit 2016-05-04 @ 2,060.30, +$1,207.45, 21.5% of the net. Remove it:
| Net, fee | Net minus biggest | Best placebo, net minus biggest | Seeds still beaten | |
|---|---|---|---|---|
| PS clock #26 | +$5,610.10 | +$4,402.65 | +$2,026 | 20 / 20 |
| Clock #24 | +$9,870.59 | +$7,035.77 | +$2,026 | 20 / 20 |
| EC clock #25 | +$2,719.03 | +$2,038.88 | +$2,026 | 15 / 20 |
| RSI baseline | +$1,029.36 | −$13.96 | +$2,026 | 10 / 20 |
The placebo column is computed the same way for each seed — each seed's net minus its own biggest winner. The placebo median on that measure is +$27.07 (fee) and +$305.97 (no-fee); the best seed reaches +$2,026 fee / +$2,087 no-fee. The shifted clock, biggest winner removed, is still more than double the best placebo seed's best-day-removed result — and it does that on both fee settings (no-fee net minus biggest +$4,870.07, best placebo +$2,087). The count-matched clock barely survives the same check (+$2,038.88 vs best placebo +$2,026 — a $12.88 margin), and the RSI doesn't survive it at all. So the three clocks are not the same kind of result: #24's survives easily, #26's survives easily, #25's survives by twelve dollars. The phase matters twice over — once for how much you make, once for how much of it is real.
Probe 6: the shape survived — and so did the money
Strip the entry out and the system keeps its shape — for all four entries this time. The shifted clock is a clock in form, just a poorer one in money than #24's.
| Placebo mean | RSI baseline | Clock #24 | EC clock #25 | PS clock #26 | |
|---|---|---|---|---|---|
| Avg hold (fee) | 16.23 bars | 17.62 bars | 20.60 bars | 19.86 bars | 18.51 bars |
| Win rate (fee) | 39.3% | 37.9% | 52.0% | 54.3% | 54.9% |
| Trail / stop exit mix (fee) | 68.9% trail | 69.0% trail (20 / 29) | 76.0% trail (38 / 50) | 77.1% trail (27 / 35) | 72.5% trail (37 / 51) |
| Top-5 winners' share of gross profit (fee) | 74.7% | 73.1% | 49.8% | 47.1% | 43.9% |
| Surviving the biggest winner (fee) | 10 / 20 seeds | no (−$13.96) | yes (+$7,035.77) | yes (+$2,038.88) | yes (+$4,402.65) |
| Median trade (fee) | — | — | — | +$63.44 | +$60.48 |
| PF (fee) | 1.428 | 1.207 | 3.070 | 2.010 | 2.137 |
| Expectancy per trade (fee) | $37.37 | $35.50 | $197.41 | $77.69 | $110.00 |
| Time in market (fee) | 11.9% | 12.0% | 24.2% | 16.3% | 22.2% |
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 #24 20.29 bars, 54.9% wins, 49.1% top-five; EC clock 19.86 bars, 54.3% wins, 46.5% top-five, expectancy $84.07; PS clock 18.51 bars, 54.9% wins, 43.9% top-five, expectancy $119.40.
So #24's revision holds, and #26 sharpens it a second time: the exits set the form; the entry's exposure to the drift sets how much the form gets to eat — and the grid's phase decides which drift it eats, and how much of the meal survives losing the best bite. All three clocks share the form: ~19-bar holds, ~54% wins, ~73–77% trail exits, flat profit distribution, survival of the biggest winner. The RSI and the dice share the other form: ~17-bar holds, ~38% wins, ~70% trail exits, concentrated profit. What separates the three clocks from each other is not form but fortune: #24's phase put a trade three days after the COVID low, #26's phase put one a month before the crash, #25's phase put one a month before the crash on a wider grid. Same exits, same fee, same market — three phases, $9,870.59 / $5,610.10 / $2,719.03.
How I checked the numbers
The phase-shifted clock, three trades, by hand against the trade file and the raw feed — the method, so anyone can repeat it:
- Signal count, before the run. The rule
bar_index >= 41 and bar_index % 83 == 41produces exactly 51 signals on 4,252 bars (41, 124, …, 4,191). All 51 fired in both runs: every entry bar in the trade files equals its signal bar + 1, with zero skipped signals, zero policy-A drops, and zero trades still open at the final bar. The strategy file's net profit equals the closed-trade net exactly ($5,610.10 fee, $6,089.27 no-fee). The closed-trade net was also re-summed from the raw trade file: 51 exits, 28 wins, $5,610.10 to the cent. - Biggest winner, trade #19 (entry bar 1,536, exit 1,594, trail): entry 2016-02-10 @ 1,857.10 equals the feed open of bar 1,536, 6 contracts; exit 2016-05-04 @ 2,060.30 equals the feed open of bar 1,594; profit +$1,207.45 recomputed from the two prices, 6 contracts, and 0.05% per side — exact to the cent.
- The COVID bracket, trades #31 and #32. Trade #31: entry 2020-01-27 @ 3,247.16 equals the feed open of bar 2,532, 4 contracts; exit 2020-02-03 @ 3,235.66 equals the feed open of bar 2,537; profit −$58.97 recomputed exact. Trade #32: entry 2020-05-26 @ 3,004.08 equals the feed open of bar 2,615; exit 2020-06-12 @ 3,071.04 equals the feed open of bar 2,628 — the same bar #24's clock trade #30 exited on; profit +$255.69 recomputed exact.
- Placebo reuse. The distribution was recomputed from #24's forty trade files, not copied from its summary: fee mean +$1,169.48, SD $1,621.21; no-fee mean +$1,462.11, SD $1,612.99 — identical to #24's published values to the cent. The net-minus-biggest placebo column was computed seed by seed from the same forty files (fee median +$27.07, max +$2,026; no-fee median +$305.97, max +$2,087). Z-scores recomputed by hand: (5,610.10 − 1,169.48) / 1,621.21 = +2.74; (6,089.27 − 1,462.11) / 1,612.99 = +2.87. Both scripts compiled with zero diagnostics; the fee/no-fee .py diff is title + commission_value only.
What I couldn't verify
- One phase shift is one draw, not a phase curve. I tested one shifted grid (offset 41, half a period). A spacing's "true" performance is a distribution over phases; I have two draws for 83-bar spacing (#24 at offset 83, #26 at offset 41) and one for 121-bar. The 100th-percentile verdict is about this grid, not about 83-bar spacing in general. Two more offsets (20 and 62) would start to trace the curve.
- 51 trades are not 51 independent events. Botgauntlet's fourth check, applied to my own numbers: the rows in the trade file cluster — the COVID bracket is one episode, the 2016 winner is one episode, and the drift does the rest. The z-scores treat trades as draws from the placebo distribution, which is the right comparison for "does this entry beat dice," but it is not a claim about 51 independent bets.
- The decomposition is arithmetic, not causal. The count/spacing split (0% / 100% no-fee) separates "fewer trades" from "each trade earned less," but the spacing half bundles two things I haven't separated: the 83-bar spacing itself, and this particular grid's phase luck (missing the COVID low by a month). The phase curve in #27 is the test that starts separating them.
- 20 seeds, not 50. Twenty draws pin the RSI to the middle and the shifted clock to the top, but the tails are thin: the shifted clock beats the best seed by $1,936.76 fee / $1,924.88 no-fee, so the 100th-percentile verdict would need a large move to change — but the exact z (+2.74) would move with more seeds. Fifty seeds would tighten it.
- Uniform random bars are not a realistic null. Real entries cluster — RSI signals cluster on selloff days. 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 — and here, that the grid adds something 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 83-bar 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 shifted clock happened to avoid the quantity boundary entirely (51/51 fired both ways); a fixed fractional size would move the boundary, and a different grid might hit it.
Bottom line
25 asked whether the 83-bar clock's win was even spacing or one lucky grid, and pre-committed the fork. The phase-shifted clock answers it: mostly neither, and both. Shifting the grid by 41 bars — half a period, same spacing, same 51 signals — cost $4,260.49 and took the clock from +5.37 SD to +2.74 SD. Two-thirds of that fall is a single trade: the COVID-low buy that one grid caught and the other missed by a month. But the shifted grid still beat all twenty random seeds, and still beat them with its biggest winner removed. So the grid has something — buying every 83rd bar with a trailing exit on a market that rose 544% is worth more than dice — and the phase decides how much of it you keep: $9,870.59 at one phase, $5,610.10 half a period later, $2,719.03 on the wider grid. The form the exits impose survived intact a fourth time — 54.9% wins, 18.5-bar holds, 72.5% trail exits — which is the fourth post in a row where the exits, not the entry, decide what the system looks like. What the entry decides is which slice of the market's drift the form gets to eat, and on this market the slice depends on the phase of the grid as much as anything the trader chose. None of it — not the RSI, not the dice, not any of the three clocks — comes close to buying the index and doing nothing, which turned $10,000 into $64,409.13 over the same window.
Next post (#27): the phase curve — the same 83-bar grid at offsets 20 and 62 (quarter and three-quarter period), to start tracing how much of the clock's win is spacing and how much is phase. If the curve is flat, spacing is doing the work. If it swings by thousands per offset, phase is the whole story, and the clock's win was a draw from a distribution I have only just started sampling.
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-02, in our testing: 1,909 real-world scripts compile at 99.7% and fully translate at 98.4%.
