Run a team of debating AI paper traders on simulated stock trades

Sayantan Sanyal set three Claude Code subagents with opposing styles loose on $50K each in fake cash; over 5 rounds all lost ground, and only the technical trader kept pace with the S&P 500.

Done withClaude Code· Oct 17, 2026

What they did

Sayantan Sanyal built a paper trading simulation inside Claude Code. Three subagents each hold their own $50K fake portfolio and a narrow outlook: a technical trader that reads RSI, MACD and moving averages, a fundamental trader that looks only at valuation, debt and margins, and a retail investor that follows news and momentum. A manager agent takes his questions and runs turn-by-turn debates in which each trader tracks a buy, hold or sell stance and a conviction level, with a 5-minute timeout. Market data comes from yfinance. A deterministic Python script places every trade and does all the arithmetic, and a reviewer agent logs results and feeds lessons back to the traders.

How it went

Across 5 rounds over 3 days, every trader lost money in what he calls a bad week for the market. The technical trader stayed mostly in cash and tracked the S&P 500 closely; the fundamental trader kept averaging into losers and trailed the index by four points; the retail trader lost to its own flip-flopping. In one debate on three tech stocks to buy, all three agreed on NVIDIA and Google within seven turns but hit the timeout still split between Broadcom and Microsoft.

Worth knowing

It is fake money and a short run, and the author says plainly it is not a trading tool or advice. His main design rule: the model decides, but a plain script owns position sizing and portfolio edits. The code is public on GitHub and needs no paid API keys beyond Claude Code.

Try it

With Claude Code· 7 parts to fill in

Set up a paper trading simulation with [number] subagents, each holding [starting cash] in fake money and a different strategy: [e.g. technical, fundamental, news-driven]. Pull prices from [market data source]. When I ask a question like [should I buy this stock], run a turn-based debate where each agent states a position, rebuts the others and records a buy, hold or sell stance with a conviction level, ending at agreement or after [time limit]. Route every trade and calculation through a deterministic script, never through the model. Log each round's results against [benchmark index]. Never connect a real brokerage account.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related