Backtesting Investment Strategies (with Claude Code)
•By Dave Wang
A common question I get from readers is some version of this:
“I have a market hunch I want to test. How do you test a new strategy before committing real capital to it?”
Before AI, the honest answer was: you mostly don’t.
Not if the strategy requires especially cross document work. That kind of rigor used to cost weeks of analyst time.
But now you can do this of course with AI, especially with tools like Codex and Claude Code.
So I ran one to show you this week.
The hypothesis: For US consumer product companies that source from Asia, many suppliers tend to report earlier and their earnings may be a leading indicator for downstream earnings.
I picked $LULU. Where they manufacture their pants in Asia.
(I'm wearing the Lululemon ABC pants as I write this)
So the question we want to answer is if we can use AI to read Chinese / Korean / Japanese filings to predict downstream US earnings.....
Three steps we bake into our Claude Code research logic:
Discover LULU’s Asian suppliers from scratch across five independent channels
Pull their pre-print earnings commentary in the original languages
Lock a prediction before touching consensus or actuals, then score it
The Methodology
I used Claude Code with a multi-agent fan-out. Five parallel discovery channels surfaced Asian supplier candidates across Taiwan, Hong Kong, and Korea.
Then ten parallel sub-agents pulled their pre-print earnings commentary in original languages, translated and synthesized across the 90-day window before the print.
Breadth first, then depth. Breadth is the five discovery channels running simultaneously. Depth is the ten per-supplier agents reading filings, broker notes, and local press in the original language.
Five of seven forecast dimensions beat sell-side consensus.
Four wins stand out:
Q4 Revenue: predicted $3.62-3.67B vs $3.58-3.60B consensus, actual $3.64B
Q4 Gross margin: predicted +20-50bp above consensus, actual +30bp beat
FY26 Revenue guide: predicted soft, actual $11.42B mid vs $11.52B consensus
FY26 EPS guide: predicted soft, actual $12.20 mid vs $12.58 consensus ($0.38 miss)
To show you how reading upstream suppliers actually drives a differentiated call, look at the single piece of Korean reporting the backtest surfaced...
LULU's Korean supplier indicated strong demand from its customers weeks before LULU's earnings. Source: Link
That’s Daily Hankook from February 27, wrapping a Korean corporate disclosure that Hojeon (KOSPI 111110) filed the day before.
Hojeon is one of Lululemon’s largest Korean apparel OEMs, with LULU running roughly 21% of its mix.
The key sentence is buried in the middle of the article.
"미국발 관세 이슈에 따른 관세 분담 비용이 발생하면서 영업이익은 일부 감소했다."
Translation: "Operating profit declined partly due to tariff-sharing costs arising from US tariff issues."
Hojeon was telling its investors, in Korean, that it was absorbing part of LULU's US tariff burden. That single sentence, filed seven weeks before the print, was the load-bearing data point behind the workflow's gross-margin beat call.
I don't read Korean. The translation, the synthesis, and the read-through all happened inside Claude Code. The signal was just sitting there in a Korean corporate disclosure with no English-language sell-side coverage I could find.
The idea is this might be an Asian supplier I now track going forward if I cover LULU.
Replicate this across not just the most recent quarter, but re-run this for each quarter for say the last 4-8 and you'll have a solid dataset of which upstream supplier might be high signal!
Here's what this run actually answered about backtesting at scale.
If you set up your research hypothesis, AI can fill in the details.
Put another way: the hypothesis behind this workflow, that Asian suppliers report in original languages weeks before the US brand's print and the sell-side doesn't read them, is not something a model invents on its own.
Multi-agent workflows changed what one operator can produce:
- 5 parallel discovery channels across 5 independent databases
- 10 parallel sub-agent deep dives, one per supplier
- 2 parallel ground-truth pulls for consensus and actuals
Running those steps sequentially would have taken a supply-chain analyst weeks.
Running them in parallel with Claude Code took an afternoon.
Personal
Last week I presented to 200+ CIOs and PMs from some of the largest asset managers at one of Citi's major conferences.
The topic was how to actually use Claude Code for real investing workflows.
I realized there's no real reason this kind of material should only sit inside the funds with the resources to fly me in for a private workshop.
That's what inspired me to open up something similar in an online format anyone can join.
As I've mentioned in previous weeks' newsletters, I'm running a five-day live cohort June 1 to 5, called Claude Code for Investors.
Daily at 8 PM ET.
We'll walk through the multi-agent workflows powering builds like this one, the MCP wiring that pulls in market data and filings, and the discipline that keeps a backtest honest.