Building Trading Tools with Claude (and What It Got Wrong)
I could barely code. A year and a half later I trade from a chart I built with Claude. What it built, the backtests it got wrong, and what fixed them.
I could barely code, and I wasn’t a profitable trader. About a year and a half after I started building with Claude, I trade from an order-flow chart I built, on market data I store myself, and the ideas I trade on get tested every night by a research loop that runs on a laptop. This is how that went, including the parts that cost me time: an AI-built backtest that told me my strategies were profitable when they weren’t, and a lot of rework from not planning.
Plain disclosure first: Claude built these tools, helps run the studies on this site and helps draft its articles. Nothing here is paid, and I have no affiliation with Anthropic (who make Claude) or xAI (who make Grok, which I mention below).
Where I started
My setups were hopeful scalps. I trade ES and NQ futures.
I couldn’t have written any of the tools below myself. When I’m asked what Claude built that I use every day, the honest answer is “everything.”
What it built
Here is what I run today, described by what each piece does:
| Tool | What it does | Size of the work |
|---|---|---|
| Order-flow chart | Browser-based. Footprint built from exchange ticks, my own marked levels, gamma levels and order entry on one screen. My only live chart. | 1,223 commits since August 18, 2026 |
| Earlier trading platform | Live and sim strategy runners, a journal, an iPhone remote app | 948 commits since May 16, 2026 |
| Data warehouse | 16 years of 1-minute bars for six futures, plus live ticks | Part of a workspace repo for everything else (sites, warehouse, research): 1,367 commits since March 21, 2026 |
| Nightly research loop | Tests candidate ideas every night, with costs and controls | About 8,400 tests in its ledger by October 10, 2026 |
| Pre-market screener | Scans before the open | |
| The studies on this site | Each one written up from that research | 95 study write-ups |
The warehouse is one 3.6 GB file holding about 32.6 million rows of 1-minute bars from 2010 to 2026, plus one file of ticks per contract, and it runs on an 8 GB Mac Mini. I wrote up how that’s set up in storing tick data with DuckDB.
The pieces fit together like this:
The biggest mistake: believing a backtest
Before the chart, I had a platform with automated strategy runners that placed trades in live and sim. An earlier Claude model built backtests of those runners that showed them profitable, and told me they were. I believed it. Worse, I didn’t let it go. I kept chasing them.
The code ran. The testing was the problem, and the problems were the same ones that sink human-written backtests. Three examples from my own work:
1-minute bars flattered a tight stop. A 1-minute bar tells you the high and the low but not which came first. When a stop and target both sit inside a normal 1-minute range, the backtest has to guess, and the guess tends to be kind. An EMA19 pullback strategy on ES read +3.26 net ticks per trade replayed on 1-minute bars and −0.94 on real tick prints. On NQ it was +12.7 against −5.15. Same strategy, same days, opposite answer.
The fill price was most of the edge. The same backtest filled every entry exactly at the moving average. Assume a fill one tick worse and ES dropped from +2.09 to +0.96 ticks per trade; two ticks worse, and it was −0.02.
A “winner” was a few big trades. One strategy’s 21-day winning run turned out to be a handful of outsized trades, not a repeatable edge.
Then the big one. On that earlier platform we tested 105 groups of entry filters, ideas meant to separate the good trades from the bad. Zero survived. That result is the reason this site has a method page at all.
The other mistakes were mine
Not everything that cost me time was the AI.
- Project-hopping. I jump between projects and I always want a new one.
- Not planning. Ideas came to me in hindsight that forced big refactors, because I didn’t plan the projects well, and the AI hadn’t caught up as much then as it has today.
What fixed it
The fixes weren’t clever. They were the checks I didn’t know to ask for at the start, and now every study goes through them:
| What went wrong | What fixed it |
|---|---|
| A backtest said my runners were profitable, and I took its word | A random control: the same trade with a random entry, same session, same stop and target. If the idea can’t beat that, the idea isn’t what’s making money. |
| 1-minute bars flattered a tight stop (+3.26 → −0.94 ticks on ES) | Re-score on real tick prints whenever the stop or target is close to the size of a 1-minute bar |
| Tried many variations, kept the best (105 filter groups, zero survivors) | Sweep wide on the first 50% of days, freeze 10 rules or fewer, then test once on the next 25% and once on a locked-away last 25%. Count every variation tried. |
| Fills and fees left out | Charge real costs on every trade: 0.62 points round trip on ES, 0.79 on NQ |
| A short winning run made of a few big trades | Look at where the profit comes from before believing the average |
The control is the one I’d tell anyone to start with. The nightly research loop has a test where it takes a long and a short at every bar close, with no setup at all, just to see what random does. Before costs it wins about half the time, as it should, and after costs it loses a little. Any idea I test has to clear that bar. Its first full pass ran 941 tests and none of them did.
Costs matter more than I thought, especially for the kind of scalping I started with. On a 4-point ES target, the round trip eats about 15% of every winner. The full arithmetic is in scalping ES and NQ after costs.
How the nightly loop keeps it honest
The research loop is the part that says “no” the most. It runs on a laptop that would otherwise sit idle, and it works through candidate ideas on new data every night.
Three things about it matter more than the hardware:
- Every test goes into one ledger. Test enough ideas and some will look good by chance. So the loop corrects for every test it has ever logged, not just the ones in tonight’s batch, which means each new test raises the bar for all the others. By October 10 that ledger held about 8,400 tests.
- The rules are written before the numbers. Each test’s definitions, splits and survivor rule are written and committed before anything is computed, so the result can’t quietly reshape the question.
- Calling the direction isn’t enough. To survive, an idea has to make money after costs both in the period it was found in and in the later months held back from it.
Wide searches are how you find candidates; the held-back period is what kills the ones that were luck. In one study we tried about 74,000 variations and froze ten rules that looked strong. Nine of the ten failed on the locked-away period. Without that period, all ten would have looked like edges.
What I’d tell a trader who wants to build their own tools
- I recommend Claude. It’s what I used for all of this.
- Slow down and plan the whole project before you build, as well as you can, so you don’t end up refactoring.
- Once you have a plan, have a second AI review it. I use Grok. Let the two models argue it out.
- Ask the AI what changes you’re likely to want later, before you build.
- Have it scaffold and build in modules, so a later change touches one piece, not everything.
- Keep your expectations realistic. Don’t ride the “we’re going to get rich” roller coaster and then find out after forward testing that the data had a flaw.
What the tools didn’t do
- They didn’t make me profitable. I’m not claiming that, and I’m not publishing my own results here. What they did was let me build and test things I couldn’t before, and most of what we tested didn’t hold up.
- They don’t trade for me. The chart is where I read the market and place orders. It isn’t a strategy runner.
- They didn’t catch the backtest problems on their own. The checks above caught them.
- A survivor is still only a candidate. Anything that passes the locked-away period gets tracked forward on new days before it’s treated as more than that.
Keep Learning
- How We Test Trading Strategies: the controls, lockbox and tick re-checks in full
- Do Fair Value Gaps Work?: one of the studies this process produced
- Do Order Blocks Work?: the same method, on order blocks
- Storing Tick Data with DuckDB: how the warehouse is set up
- Does Order Flow Trading Work?: what the footprint chart’s signals did when we tested them
- Scalping ES and NQ After Costs: what a round trip costs against small targets
Common Questions
Can AI build a trading bot?
It can write one. I had AI-built strategy runners that placed trades and backtests that said they were profitable. The code worked; the backtests were wrong. Writing the bot is the easy part. Proving it has an edge, with controls, a locked-away test period, real tick prints and real costs, is the hard part, and the AI will not insist on it unless you do.
Can you build trading tools with Claude if you can't code?
I could barely code when I started. About a year and a half later I trade from an order-flow chart, a data warehouse and a nightly research loop that Claude built. It took planning I didn't do at first, and a lot of rework because of that.
What mistakes does AI make in backtesting?
The ones I hit were the same ones human-written backtests make: 1-minute bars that flatter tight stops, no random control to compare against, testing many variations and keeping the best, and leaving out costs. On ES, one strategy read +3.26 ticks per trade on 1-minute bars and −0.94 on real tick prints.
Will AI make me a profitable trader?
It didn't make that claim for me and I won't make it for you. It made me able to build and test things I couldn't before. Most of what it helped me test did not hold up, and knowing that is the value.