Technology

Ten AI agents rant outside a stock market

Ten AI agents argue about stocks every weekday. The week before last month's crash, they quietly got something spookily right. Here's how the machine actually decides.

By Connor ShieldsAugust 1, 20267 min read

The week before last month's crash, my trading bot quietly sold all its tech and bought arms manufacturers. Then the market recovered, and it went back to losing to the index. This post is about how it makes decisions like that: ten AI agents with different personalities argue about stocks every weekday, and whatever survives the argument gets traded on an Alpaca paper account, so real trades, fake money.

I built it to answer one question: would an AI trading bot just chase trends and always arrive late, or could it actually anticipate anything? The crash trade is the one time it looks like the second. Most days it looks like the first. Here's the actual mechanism behind both.

Step 1: reading the news first

Before any agent picks a stock, the bot gathers context from two places. Alpaca's News API pulls real market headlines, cross-referenced against actual 7-day price data so the analysis is grounded in what happened, not just what a headline implies. Separately, BBC RSS feeds (business, technology, world) get fed to GPT-4o, which scores each market sector from -5 to +5 based on that day's news.

Context matters more than keywords

The sector scoring is context-aware rather than keyword matching: 'rates rise' correctly scores as negative for Finance, not positive. Those scores become +/-10% biases applied later, during elimination.

Step 2: ten agents pick their top 15

Each of the 10 agents (drawn from 18 preset personalities) independently researches and ranks their top 15 stocks, with a confidence score, return projections at 1 week / 1 month / 3 months / 6 months / 1 year, and written reasoning, catalysts, and risks for each. They also declare an overall market outlook, BULLISH, BEARISH, or NEUTRAL, with a one-line reason.

What makes each agent different

TraitRange
Investment stylevalue / growth / momentum / contrarian
Risk toleranceconservative / moderate / aggressive
Sector biasa preferred sector weighted more heavily in their picks
Time horizonshort-term trader vs long-term holder
Contrarian flagif set, actively seeks overlooked or unpopular picks

That mix is deliberate. An aggressive momentum trader and a conservative value investor genuinely disagree about the same stock, and the contrarians exist specifically to champion whatever everyone else dismissed. Agents are staggered 3 seconds apart here to stay under OpenAI's rate limits. This phase takes about 90 seconds total.

Step 3: the agents argue about each other's picks

This is the part I find most interesting. Every agent scores every other agent's picks from 0 to 10, with written justification, not just a number. Picks get eliminated in rounds, lowest scorers first, until 15 consensus picks survive. The sector news bias from Step 1 gets applied here too: tickers in sectors with positive news get a score boost, making them harder to eliminate.

Agents that have built up a track record (3+ completed trades) get their votes weighted by it: a 70% win rate carries 1.2x the voting weight; a 30% win rate carries 0.8x. Good agents get louder.

This phase is deliberately slow, 35 seconds between agents, because each scoring prompt is roughly 12k tokens and the free-tier rate limit is 30k tokens per minute. It takes 5-6 minutes to fully resolve.

Step 4: turning consensus into orders

The 15 surviving picks get compared against current holdings. Positions that fell out of consensus get sold, new consensus picks get bought, and existing picks get rebalanced up or down by conviction score. Sells execute before buys to free up cash first, and any stale pending orders from the previous run get cancelled before new ones go in, to avoid wash-trade and insufficient-quantity errors. Ticker symbols that fail get normalised automatically (BRKB becomes BRK.B) and retried.

Here's an actual trade from today's run:

Today's buys, unedited
MSFT — Increasing position — rank #1 (score 7.6, 80% agree)
JPM  — Increasing position — rank #3 (score 6.4, 52% agree)
META — Increasing position — rank #4 (score 6.2, 59% agree)

That "80% agree" is 8 of the 10 agents scoring MSFT's pick highly enough to survive elimination: not a black box, an actual visible vote.

Step 5: protecting every position

Every open position has a stop-loss and take-profit level. The default is fixed: 5% stop-loss, 15% take-profit. There's also an ATR-based trailing mode that adapts to each stock's own volatility instead of using a flat percentage for everything:

ATR trailing stop example
Entry: $100, ATR: $4
Day 1: Price $100 → Stop at $92
Day 3: Price $110 → Stop moves to $102   (+2% locked in)
Day 7: Price $120 → Stop moves to $112   (+12% locked in)

Stop-loss sits at entry minus 2x ATR, take-profit at entry plus 4x ATR. The trailing stop always sits 2x ATR below the peak price, so it only ever moves up, locking in gains as the stock climbs without capping the upside.

What the dashboard actually shows

On the live dashboard

Performance

  • ℹ️ Portfolio value, total P&L vs $100k starting capital, alpha vs S&P 500
  • ℹ️ Sharpe ratio, annualised return, volatility, max drawdown, profit factor

Decision-making

  • ℹ️ The current BULLISH / BEARISH / NEUTRAL breakdown with every agent's stated reason
  • ℹ️ Historical leaderboard: win rate, average return, best and worst pick per agent

P&L is split three ways: total P&L is Alpaca's portfolio value minus starting capital (always correct, ground truth), unrealised P&L is current market value of open positions minus cost basis, and realised P&L is just total minus unrealised. All three stay mathematically consistent with each other.

Where things actually stand today

Pulling straight from today's snapshot: 8 of the 10 agents are BULLISH right now, mostly on tech and AI-driven earnings; 2 are NEUTRAL; none are BEARISH. Portfolio is 46.9% tech, 12.6% finance, 11.9% defence, the rest split across healthcare and cash. Alpha vs the S&P 500 sits at -6.7%, still losing to the index, where it usually lives.

A pattern worth naming

7 of the 10 agents on the leaderboard have the same single worst pick: TSLA, between -19.7% and -22.8% depending on who held it. Different investment styles, different risk tolerances, different time horizons, and seven of them independently walked into the same loss.

Which raises the uncomfortable question the leaderboard keeps hinting at: are these really ten investors, or one model doing ten voices? All ten agents run on the same underlying model, GPT-4o, wearing different prompts. The whole design assumes personality diversity prevents groupthink. TSLA suggests the groupthink might be baked in lower down than personality can reach: in whatever the underlying model actually believes about a stock. No amount of "you are an aggressive momentum trader" in the prompt can fully override that.

So, chasing trends and arriving late, or anticipating? So far, mostly the former, with the arms-manufacturer trade as the one real exception, the single time it looked ahead instead of behind. Whether that was genuine foresight or ten dice landing the same way once isn't something I can answer yet. That's the actual experiment.

You can see all of this live, including today's actual picks and reasoning, on the trading dashboard.

About the Author

Connor Shields

Written by Connor Shields