Skip to main content

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

๐Ÿค– 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, AAPL in 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

  1. Copy the sample environment file:

    cp env.sample .env
    
  2. Edit .env with 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
  1. 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:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tradingcrew-0.2.6.tar.gz (319.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tradingcrew-0.2.6-py3-none-any.whl (343.9 kB view details)

Uploaded Python 3

File details

Details for the file tradingcrew-0.2.6.tar.gz.

File metadata

  • Download URL: tradingcrew-0.2.6.tar.gz
  • Upload date:
  • Size: 319.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tradingcrew-0.2.6.tar.gz
Algorithm Hash digest
SHA256 db327b6272af6a75e818955a25b311940084b41d89f461e2de068e38d0a25207
MD5 c960f97ed26891cf6f7bd347e3da895f
BLAKE2b-256 fd6ada4987f7596d0c5cd12bac08f98be6b52a707b64d85e27600a9a2827139b

See more details on using hashes here.

Provenance

The following attestation bundles were made for tradingcrew-0.2.6.tar.gz:

Publisher: release.yml on rminchev1/TradingCrew

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tradingcrew-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: tradingcrew-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 343.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tradingcrew-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7c7a164c83b77ad4e62c418088a3cf50b048a1f37646d6461a2e50b7c442d191
MD5 81db87cafee3d94441e534c355d63fd2
BLAKE2b-256 e37cb65e25f70fad4044ef4abcece5660ffb2748a53ebe5fadf60f536ae4ed08

See more details on using hashes here.

Provenance

The following attestation bundles were made for tradingcrew-0.2.6-py3-none-any.whl:

Publisher: release.yml on rminchev1/TradingCrew

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page