Favicon of TradingAgents

TradingAgents

An AI trading research framework uses analyst debates, portfolio risk checks and backtesting with local models or cloud providers.

TradingAgents is an open-source Python framework for researchers and developers studying AI trading decisions. It assigns market analysis and risk assessment to separate LLM agents, then combines their findings into a proposed trade for a simulated exchange.

  • Analyst debates: Agents examine company fundamentals, technical indicators, news and social sentiment, while bullish and bearish researchers debate the findings.
  • Portfolio-aware decisions: The trader and risk team can assess proposals against your supplied cash balance and positions before the portfolio manager accepts or rejects them.
  • Historical evaluation: Backtests compare decisions across tickers and dates against regional benchmarks; SEC EDGAR fundamentals reflect what companies had filed by the analysis date.
  • Decision memory: A persistent log tracks past decisions and their realized returns, giving later analyses access to earlier outcomes and lessons.
  • Reviewable reports: Saved HTML reports collect the analysis in one page for browser reading or printing, and optional checkpoints let interrupted analyses resume.

The framework runs on your own machine or server, including through Docker, under the Apache License 2.0. Local model backends include Ollama and OpenAI-compatible servers such as vLLM, LM Studio and llama.cpp. You can also use cloud providers such as OpenAI, Anthropic and Google, with separate models and providers for analysts and managers. Cloud model calls send their inputs to the selected provider; market data comes from external services.

It covers markets available through Yahoo Finance, including international stocks and crypto. Historical runs withhold Yahoo company statements and insider trades when publication timing can't be established. It's intended for research rather than financial advice, and repeated runs can produce different decisions because model outputs and live data vary.

Similar to TradingAgents