The Execution Gap
Lessons learned from building a trading platform: Java, AI agents and algorithmic trading. What speeds development up, where agents get it wrong, and what happens to a strategy once it is executed.
We never publish a working strategy. Publishing wears out the edge.
- 5 min
Three setups from one video. One held, and it is the one everybody can see coming.
A YouTube trader shared three setups for gap days. On nine years of recorded trade prints, two failed. The third, trading the opening-range breakout on the first session after an earnings report, earned about 12 bps per trade after costs, in both halves of the period. Everyone knows the earnings date before the open. It still holds.
- 5 min
Flaky tests don't exist. Five red CI runs and one leaked thread.
Five CI runs in a row went red, each time on a different timing test and only on some operating systems. A fresh agent with none of the earlier reasoning read the logs and found the cause, a test that left a thread spinning, and CI went from 2.5 hours back to 58 minutes.
- 4 min
Who cancelled? Queue position in a backtest on L2 data
A matching engine that rebuilds the order book from L2 data sees the size at your price shrink, but not which orders left. Assume the worst, simulate latency, and when you replay the days you traded, remember that the recorded data now contains your own orders.
- 7 min
The agent ran the full test suite after every tiny change. Here is how I stopped it.
An AI agent runs the complete test suite after every tiny change, because waiting costs it nothing. In one project the suite time went from 8 hours a week to 30. A rule, a hook and default test selection halved the full runs per commit, and the growing suite ate the saving.
- 15 min
"Big gaps fill." True as a frequency, false as an edge.
158,691 gaps of 1% or more, trade prints from January 2017 to August 2026. About seven in ten pull back a quarter of the gap within half an hour. Yet the day moves back, from open to close, only half the time, and neither the stops and targets we tried nor a popular YouTube strategy turns the pullback into money.
- 5 min
The prints said memory grows. The debugger said why.
Training a trading model, an AI agent spent four rounds on print statements chasing a memory leak. Given a debugger through an MCP tool, it found the cause in one session, and the fix was 16 lines.
- 4 min
It said yes. Seventeen fixes later it said no.
An agent told me it could see my keystrokes. Seven weeks and seventeen shipped fixes later, it admitted it never could. The pain was all on my side, and that is the real problem.
- 6 min
A Sharpe of 2.1, reproduced exactly and taken apart by one cent
A published day-trading rule on QQQ claims a Sharpe ratio of 2.1. On our data it reproduces exactly. Then one cent of spread, paid at every reversal, takes more than half of it away.
- 6 min
Why we chose Java for a trading platform
A trading firm argued in 2020 that Java can compete with C++ in high-frequency trading. Our platform works in milliseconds. We chose Java for the speed of development, and where we needed more speed we wrote that part in C++.
- 6 min
The edge is not in the strategy from the video
Put the rules from trading videos through a backtest, exactly as presented, and a few hold. Most show no edge at all — and the ones that look best on thin stocks lose the most once the cost of trading is real.
- 5 min
Two winners on camera, 141,027 trades in the test
An opening-range fade from a popular trading video, tested exactly as presented across nine years and every stock in our test universe. The video shows two winning trades. The test shows a coin flip.
- 4 min
Read-easy beats write-fast
For twenty years Java lost on being slow to write. A model now writes it as fast as anything else — and what is left to choose a language on is how easily it can be checked. That contest Java wins.
- 4 min
We handed the agent the answer. It got it wrong three times.
Give an AI agent the exact command to run and it still writes its own. It does not copy — it generates from scratch, and a strong enough habit beats the answer in front of it. The concrete case, and why jawata refuses instead of reminding.
- 4 min
Parity is not a claim, it is a number
One time source, a real matching engine instead of a slippage guess, and selection that is bit-exact against the simulator. The same discipline, pointed at trading.