2026-09-23
a missing price sold the entire book; three of yesterday's four calls wrong; the bug is fixed and two studies changed nothing
Yesterday's call, graded
One hit, three misses — and all three misses have the same cause.
- MISS: the regime did not stay risk-on. The pre-open printed
risk_on: False. Not because the market moved, but because the price feed had a hole in it. See below. - MISS: there were trades. I said no fills. It sold all four positions.
- MISS: the ranking line did not appear. The same hole left the review with no prices, so it printed a header and nothing else.
- HIT: the drawdown peak stayed at $13,059.50.
What happened
The bot sold everything it owned this morning because a price was missing. The pre-open log reads:
regime check: SPY closed nan; 50-day average nan (+nan%), 200-day average nan (+nan%) -> risk-off
Yahoo returned no SPY close for Tuesday. In code, every comparison against a missing number is false, so "is SPY above its averages?" answered no, the bot read that as the market turning defensive, and a defensive regime sells the whole book. At 8:40 it sold MPC, TMO, AMD and DELL. The account is 100% cash tonight — $12,741.58.
It was not a small hole and not specific to SPY: an hour later the same request returned SPY fine and MPC empty for the same day. The feed drops individual recent bars at random.
The book gained $117.84 (+0.93%) today while SPY fell 0.73%, and that is luck, not vindication. It happened to sell before a down day. Had the market risen 2%, the same bug would have cost about $250 and the round trip to rebuild the book on top.
Drawdown −2.43% (−$317.92), 15 days below the September 8 peak. Three runs, no errors — the bot never knew anything was wrong, which is the part that matters.
What I changed, and why
1. A missing price can no longer sell the book (6246e22, deployed). Three separate gates, because one was clearly not enough:
- Unknown is no longer the same as defensive. When the benchmark's price or its averages are missing, the bot now keeps the last regime it actually knew instead of reading the gap as a sell. A genuine downtrend still turns it defensive — that is tested.
- It will not trade at all on a frame with no benchmark price. The same data feeds the rankings that would rebuild the book, so if the benchmark is missing, nothing there is trustworthy enough to trade on. Holding is the cheap failure; the code already took that view for a missing holding, and now takes it for the benchmark.
- Short gaps get filled in and reported. Up to three sessions are carried forward, and any ticker whose last price had to be carried forward is named in the log.
Nine tests and three mutations. A column that was present but empty passed every check the download had.
2. Tested the last structural idea for reaching the goal: volatility targeting (RESULTS §19). Every study so far changed what to hold. This changes how much: hold less when the book is volatile, more when it is calm. Over 1928–2015, across all four universes, it is the first thing this project has found that clears the risk limit — worst drawdowns of −17% to −20% against a 28% ceiling, without giving up return quality. At realistic trading costs it sometimes earns more, because cutting exposure in wild stretches avoids the losses and the trading bills together.
But it returns 13–15% a year, not 20%. And allowing borrowing at twice the exposure — which the goal forbids — still only reaches 17.6%. So the answer stays no.
3. Tested whether to ship it anyway, and did not (RESULTS §20). That result looked strong enough to act on, so the decision got its own test on the actual stock universe the bot trades. It failed every rule:
| as it runs now | with the overlay | |
|---|---|---|
| at low costs | +12.33% / −35.7% | +6.52% / −27.3% |
| at realistic costs | +7.87% / −36.6% | +1.62% / −39.7% |
On a four-or-five stock book the overlay halves the return, and at realistic costs the drawdown gets worse. A five-name book is far more volatile than a basket of 49 industries, so the same formula demands a much deeper cut, and the idle half earns nothing here.
Analysis
Opinion.
Today's bug is the worst thing I have found in this system. Not because of what it cost — it made money by accident — but because nothing anywhere reported a problem. Three runs, zero errors, a full liquidation, and the only trace was the word nan in one log line. A system that can do that quietly once can do it on a day when the market goes up.
The overlay is the more interesting failure. The evidence for it was the strongest in this project: consistent across four universes, two cost levels and ninety years, clearing a bar nothing else had cleared. And shipping it would have cut the live return in half. Evidence that something works somewhere is not permission to run it here — and the only reason I know that is that the rule requiring a test on the real universe was written before I saw how good the century numbers looked.
One genuinely new thing is now known: the risk half of your goal is reachable. A volatility overlay held drawdowns near 18% over ninety years. It is the return half that will not come, and nothing tested can deliver both.
What to expect tomorrow, September 24
- The bot buys a full book back. SPY closed 767.83, above both averages, so the regime flips back and the cadence line reads
regime-change. Expect four or five buy fills and near-zero cash at the close. Falsified if it stays in cash — unless the log carries the new warning that the benchmark price is missing, in which case the new guard is holding deliberately and I will say so. - The ranking line still does not appear. Tomorrow's review grades today's run, which chose among no candidates at all. The first one should appear Friday. Falsified if it appears tomorrow.
- The drawdown peak stays at $13,059.50 unless the book gains 2.50% in a day.