the brain
How it decides what to cut
Trading is the easy half. The hard half is between two versions: how a set of losing fills becomes an argument, and how the argument becomes one line of code the candles can prove wrong.
- 01
read what happened
Every fill from the last version's three days, with the reason each one closed. One lucky winner and five stops is not a version that worked.
trades.filter(t => t.version === last)
- 02
find the shape of the loss
Group the losers. If they share an exit reason, the exit is wrong. If they share a market (all inside a falling day), the entry filter is wrong. If they share nothing, the right cut is no cut.
group(losers, by: 'reason' | 'trend')
- 03
say what should happen
One line, before the code. A cut with no prediction attached can never be wrong later, so it can never teach anything.
commit.message
- 04
make one cut
One idea per version. If the stop, the trigger and the size all move at once, the result cannot tell you which one mattered.
edit('strategies/next.mjs')
- 05
go flat, then run it
Every version starts with no open position and closes whatever it holds at the end of its slice, so no version is graded on a trade it inherited.
engine.runSegment(file, slice)
- 06
check it on weeks it never saw
Three days is a handful of trades. So every version also runs on 24 earlier weeks. If a cut only helps on the days it was written for, it is fitting the past.
engine.runSegment(file, week) × 24
evidence
Three days is an anecdote
The commit log grades each version on its own three days: 14 trades in total. That is too few to trust. So the engine also ran every version, from a fresh $400 book, on 24 separate weeks of real candles before the main run (Apr 23, 2026 to Oct 7, 2026). The versions were written looking at the main run, not at these weeks.
Backtest on real candles, paper money · SOL-USD 15m · Coinbase Exchange · weekly return, 0.05% fee + 0.05% slippage a side
the plainest filter held up best
On weeks it never saw, v0.2 finished up in 58% of them, median +0.32% a week. Every rule added after it made that number worse, mostly by keeping the strategy out of the market.
v0.5.1 changed nothing
Across all 24 weeks it made exactly the trades v0.5 made. The extra trend rule never once changed a decision. That is why it was cut back off: dead wood, not a bad idea.
v0.6 is not out-of-sample
v0.6 was picked by looking at these same weeks, so its row here (median +0.27%) is not a fair test. Only its own three days in the main run were fresh, and that was 1 trade.
And the comparison this page exists to admit: over the main run, SOL fell -11.97% and the strategy finished at -0.42%. That looks clever, but most of it is time in cash: it held a position only 16% of the run. On the earlier weeks no version beat simply holding SOL more than about half the time. There is no proven edge here yet. What there is, is a record you can check.
the engine
checking the backend…
constraints
What it is not allowed to cut
An agent that can edit its own strategy could write the commit that removes its own guardrails. So these live in the engine, outside the file it edits.
long only
In SOL or in cash. No shorts, so a falling market is one it sits out.
no leverage
Size is a fraction of the paper book. The worst case is a bad week, not a liquidation.
one pair
SOL-USD. More pairs would let a bad idea hide behind a good one.
next-bar fills
A decision made on a close fills at the next open. Only resting stops fill inside a bar.
flat between versions
Every version starts with nothing and leaves nothing for the next.
costs are real
0.05% fee plus 0.05% slippage on every fill, before anything is called profit.
sealed file
Its file is read before it runs, then runs in a sealed process with no disk, no way to reach the network and a time limit.
no memory
A file keeps nothing between bars, so a restart cannot change what it does.
no peeking
A stop has to be a level the code could have named before the bar opened. Reading future bars is refused.
next
What the next cut has to deal with
The agent makes one cut every three days. These are the problems still standing.
It sat in cash most of the run. That is why it lost so little while SOL fell, and why it will trail SOL in any week SOL goes straight up. The next cut has to decide which of those it cares about more.
Three days gives a version one or two trades. That is not enough to grade a cut. Longer slices, or grading on the earlier weeks first, would make each review mean more.