Skip to content

Add stock market example with LLM trader and analyst agents#281

Open
hussanshabbir wants to merge 2 commits intomesa:mainfrom
hussanshabbir:add-stock-market-example
Open

Add stock market example with LLM trader and analyst agents#281
hussanshabbir wants to merge 2 commits intomesa:mainfrom
hussanshabbir:add-stock-market-example

Conversation

@hussanshabbir
Copy link
Copy Markdown

This PR adds a stock market simulation example to mesa-llm, demonstrating
LLM-powered agents reasoning over quantitative financial data.

TraderAgent — uses ReAct reasoning to decide BUY/SELL/HOLD based on
live price, RSI, and trend data. Two archetypes: conservative and aggressive.
AnalystAgent— reads market indicators and broadcasts signals to nearby
traders via speak_to.
execute_trade tool — handles buy/sell/hold logic with budget and share tracking.
StockMarketModel — simulates price movement with random walk + mean
reversion, computes RSI and volatility, collects data via DataCollector.
Solara visualization — color-coded agents (green = profitable, red = loss).

Testing

Follows the same structure as the negotiation example. Compatible with any
LiteLLM provider (OpenAI, Anthropic, Ollama).

@colinfrisch @jackiekazil happy to adjust anything based on your feedback!

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 255de2a2-a5c3-4d4e-a883-58b177d6a053

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@wang-boyu wang-boyu added the example Release notes label label Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

example Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants