TradingCrew - Multi-Agent LLM Financial Trading Framework
Project description
TradingCrew: Multi-Agent LLM Trading Framework
TradingCrew - A sophisticated multi-agent AI trading framework built on LangGraph, designed for traders who want to leverage AI agents for automated market analysis and trading.
This project extends the original TradingAgents framework with real-time Alpaca integration, crypto support, options analysis, and a production-ready web interface.
Disclaimer: This project is for educational and research purposes only. It is not financial, investment, or trading advice. Trading involves risk. Users should conduct their own due diligence.
Features | Installation | Quick Start | Web UI | CLI | API | Contributing
Features
๐ค Multi-Agent Analysis System (6 Specialized Agents)
| Agent | Role |
|---|---|
| Market Analyst | Technical analysis, price trends, indicators (RSI, MACD, Bollinger Bands) |
| Options Analyst | Options chain analysis, put/call ratios, max pain, institutional positioning |
| Social Sentiment Analyst | Reddit, Twitter sentiment analysis, social momentum |
| News Analyst | Live Finnhub news, Google News, market-moving events |
| Fundamentals Analyst | Earnings, balance sheets, SEC filings, insider transactions |
| Macro Analyst | Fed data (FRED API), yield curves, economic indicators |
๐ Dual Asset Support
- Stocks: Full analysis with options data, fundamentals, and technicals
- Crypto: BTC/USD, ETH/USD with DeFi Llama data and crypto-specific news
- Mixed Portfolios: Analyze
NVDA, ETH/USD, AAPLin a single session
๐ Production-Ready Web Interface
- Watchlist Management: Add symbols, drag-and-drop reorder, one-click analysis
- Run Queue: Queue multiple symbols for batch analysis
- Market Scanner: Pre-built scanners for gainers, losers, volume spikes, news movers
- Interactive Charts: Real-time Alpaca data with technical overlays
- Live Reports: Tabbed analyst reports, debate transcripts, tool call logs
- Portfolio View: Current positions, recent orders, P&L tracking
โก Automated Trading
- Paper & Live Trading: Test safely before going live
- Auto-Execution: Optional automatic trade execution
- Scheduled Analysis: Run analysis every N hours during market hours
- Risk Management: Position sizing, margin controls, stop-loss support
๐ง Developer Experience
- Python Package: Install via
pip install . - CLI Interface: Interactive and batch modes
- CI/CD: GitHub Actions for testing and releases
- Extensible: Add custom analysts, data sources, or strategies
Installation
Option 1: Install as Package (Recommended)
# Clone the repository
git clone https://github.com/rminchev1/TradingCrew.git
cd TradingCrew
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install the package
pip install -e .
# Or with development dependencies
pip install -e .[dev]
Option 2: Install from Requirements
git clone https://github.com/rminchev1/TradingCrew.git
cd TradingCrew
# Create virtual environment
conda create -n tradingcrew python=3.11
conda activate tradingcrew
# Install dependencies
pip install -r requirements.txt
Configure API Keys
-
Copy the sample environment file:
cp env.sample .env
-
Edit
.envwith your API keys:
| API | Purpose | Required | Get Key |
|---|---|---|---|
| ALPACA_API_KEY | Trading execution | Yes | Alpaca Markets |
| ALPACA_SECRET_KEY | Trading execution | Yes | Alpaca Markets |
| OPENAI_API_KEY | LLM agents | Yes | OpenAI Platform |
| FINNHUB_API_KEY | Stock news & data | Yes | Finnhub |
| FRED_API_KEY | Macro analysis | Yes | FRED |
| COINDESK_API_KEY | Crypto news | For crypto | CryptoCompare |
- Set trading mode:
ALPACA_USE_PAPER=True # Paper trading (recommended for testing) ALPACA_USE_PAPER=False # Live trading with real money
Quick Start
Web Interface (Recommended)
# If installed as package
tradingcrew-web
# Or run directly
python run_webui_dash.py --port 7860
Open http://localhost:7860 in your browser.
CLI
# If installed as package
tradingcrew
# Or run directly
python -m cli.main
# Analyze specific symbols
python -m cli.main NVDA
python -m cli.main "BTC/USD"
python -m cli.main "NVDA,ETH/USD,AAPL"
Python API
from tradingagents import TradingAgentsGraph, DEFAULT_CONFIG
# Initialize
ta = TradingAgentsGraph(debug=True, config=DEFAULT_CONFIG.copy())
# Analyze a stock
_, decision = ta.propagate("NVDA", "2024-05-10")
print(decision)
# Analyze crypto
_, decision = ta.propagate("ETH/USD", "2024-05-10")
print(decision)
Web Interface
The Dash-based web UI provides a complete trading workstation:
Dashboard Features
Watchlist & Run Queue
- Add symbols to watchlist for monitoring
- Promote to Run Queue for batch analysis
- Drag-and-drop reordering
- Quick-action buttons: Chart, Analyze, Queue
Market Scanner
- Pre-built scans: Top Gainers, Top Losers, Volume Spikes
- News-based movers detection
- One-click add to watchlist or analysis queue
Analysis Controls
- Select which analysts to run (Market, Options, Social, News, Fundamentals, Macro)
- Configure LLM models (GPT-4o, GPT-4o-mini, o3-mini)
- Set debate rounds and risk parameters
- Schedule automated recurring analysis
Reports & Visualization
- Tabbed reports for each analyst
- Bull vs Bear debate transcripts
- Risk assessment summaries
- Final trading recommendations
- Tool call logs with timing data
Portfolio Management
- View current Alpaca positions
- Recent order history
- One-click position liquidation
- Real-time P&L tracking
Screenshots
CLI Usage
The CLI supports interactive and batch modes:
# Interactive mode - select options via prompts
tradingcrew
# Single symbol
tradingcrew NVDA
# Multiple symbols
tradingcrew "NVDA,AAPL,TSLA"
# Crypto
tradingcrew "BTC/USD"
# Mixed assets
tradingcrew "NVDA,ETH/USD,AAPL"
Python API
Basic Usage
from tradingagents import TradingAgentsGraph, DEFAULT_CONFIG
ta = TradingAgentsGraph(debug=True, config=DEFAULT_CONFIG.copy())
_, decision = ta.propagate("NVDA", "2024-05-10")
Custom Configuration
from tradingagents import TradingAgentsGraph, DEFAULT_CONFIG
config = DEFAULT_CONFIG.copy()
config.update({
"deep_think_llm": "gpt-4o", # Reasoning model
"quick_think_llm": "gpt-4o-mini", # Fast model
"max_debate_rounds": 3, # Bull/Bear debate rounds
"max_risk_discuss_rounds": 2, # Risk assessment rounds
"online_tools": True, # Use live data
"parallel_analysts": True, # Run analysts concurrently
})
ta = TradingAgentsGraph(debug=True, config=config)
Batch Analysis
symbols = ["NVDA", "AAPL", "TSLA", "ETH/USD"]
results = {}
for symbol in symbols:
_, decision = ta.propagate(symbol, "2024-05-10")
results[symbol] = decision
print(f"{symbol}: {decision['action']} - {decision['reasoning'][:100]}...")
Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ANALYST TEAM (6 Agents) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Market Options Social News Fundamentals Macro โ
โ Analyst Analyst Analyst Analyst Analyst Analyst โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ RESEARCHER TEAM โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Bull Researcher โโโโบ Bear Researcher โ
โ (Structured Debate - N Rounds) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ RISK MANAGEMENT โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Aggressive โโโโบ Neutral โโโโบ Conservative โ
โ (Risk Assessment Debate) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ TRADER AGENT โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Final Decision: BUY / HOLD / SELL โ
โ โ Alpaca API Execution (Paper or Live) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Project Structure
TradingCrew/
โโโ tradingagents/ # Core trading framework
โ โโโ agents/ # AI agents (analysts, researchers, trader)
โ โโโ dataflows/ # Data interfaces (Alpaca, Finnhub, FRED, etc.)
โ โโโ graph/ # LangGraph workflow orchestration
โ โโโ scanner/ # Market scanning utilities
โโโ webui/ # Dash web interface
โ โโโ components/ # UI components
โ โโโ callbacks/ # Dash callbacks
โ โโโ assets/ # CSS, JS assets
โโโ cli/ # Command-line interface
โโโ tests/ # Unit tests
โโโ pyproject.toml # Package configuration
โโโ requirements.txt # Dependencies
Development
Running Tests
# Run all tests
python -m pytest tests/ -v
# Run specific test file
python -m pytest tests/dataflows/test_finnhub_news_online.py -v
Building the Package
# Install build tools
pip install build
# Build source distribution and wheel
python -m build
# Output in dist/
Creating a Release
# Tag a version
git tag v0.1.0
git push origin v0.1.0
# GitHub Actions will automatically:
# 1. Run tests
# 2. Build package
# 3. Create GitHub Release with artifacts
Contributing
We welcome contributions! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Acknowledgments
This project builds upon the original TradingAgents framework by Tauric Research. We extend our gratitude to the original authors for their pioneering work in multi-agent financial trading systems.
Citation
@misc{xiao2025tradingagentsmultiagentsllmfinancial,
title={TradingAgents: Multi-Agents LLM Financial Trading Framework},
author={Yijia Xiao and Edward Sun and Di Luo and Wei Wang},
year={2025},
eprint={2412.20138},
archivePrefix={arXiv},
primaryClass={q-fin.TR},
url={https://arxiv.org/abs/2412.20138},
}
License
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tradingcrew-0.2.0.tar.gz.
File metadata
- Download URL: tradingcrew-0.2.0.tar.gz
- Upload date:
- Size: 318.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b423440aed8e5580a9406e5ed01a310970860ed48e5c4c08cbb6ca2acfd8c7e7
|
|
| MD5 |
dc6d352b9757e1a280514404fd405a7c
|
|
| BLAKE2b-256 |
5be47a130143b0e21f6ed67db07c69833775fdcce15b7a8798c70cea002cd075
|
Provenance
The following attestation bundles were made for tradingcrew-0.2.0.tar.gz:
Publisher:
release.yml on rminchev1/TradingCrew
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tradingcrew-0.2.0.tar.gz -
Subject digest:
b423440aed8e5580a9406e5ed01a310970860ed48e5c4c08cbb6ca2acfd8c7e7 - Sigstore transparency entry: 937071369
- Sigstore integration time:
-
Permalink:
rminchev1/TradingCrew@68b41c44ad1b0a69ccf7a8384dabf7b42b8e74b5 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/rminchev1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@68b41c44ad1b0a69ccf7a8384dabf7b42b8e74b5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tradingcrew-0.2.0-py3-none-any.whl.
File metadata
- Download URL: tradingcrew-0.2.0-py3-none-any.whl
- Upload date:
- Size: 342.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28bc78cb897b1ebdb088ac6634754b5b8a8fa7bbcd06197419990df87bca52ee
|
|
| MD5 |
837a71584163f2a60af720455bb6f657
|
|
| BLAKE2b-256 |
606530cf8c588203e5f2d8b04bb977cb5b6077ba28f320e5a3f7ea575abc8e12
|
Provenance
The following attestation bundles were made for tradingcrew-0.2.0-py3-none-any.whl:
Publisher:
release.yml on rminchev1/TradingCrew
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tradingcrew-0.2.0-py3-none-any.whl -
Subject digest:
28bc78cb897b1ebdb088ac6634754b5b8a8fa7bbcd06197419990df87bca52ee - Sigstore transparency entry: 937071375
- Sigstore integration time:
-
Permalink:
rminchev1/TradingCrew@68b41c44ad1b0a69ccf7a8384dabf7b42b8e74b5 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/rminchev1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@68b41c44ad1b0a69ccf7a8384dabf7b42b8e74b5 -
Trigger Event:
push
-
Statement type: