Go to file
Jenit Jain d3fccbd4e4 Fix View Results tab 2025-08-10 10:11:37 -07:00
assets chore(release): v0.1.0 – initial public release of TradingAgents 2025-06-05 04:27:57 -07:00
cli Merge pull request #29 from ZeroAct/save_results 2025-06-26 00:28:30 -04:00
docs Add documentation 2025-08-09 19:09:54 -07:00
scripts Add documentation 2025-08-09 19:09:54 -07:00
trading_agents Initial commit 2025-08-04 19:21:55 -07:00
tradingagents Rename 2025-08-10 10:11:37 -07:00
web_app Fix View Results tab 2025-08-10 10:11:37 -07:00
.gitignore Add web-app 2025-08-09 21:32:21 -07:00
.python-version main works, cli bugs 2025-06-15 22:20:59 -07:00
LICENSE chore(release): v0.1.0 – initial public release of TradingAgents 2025-06-05 04:27:57 -07:00
README.md Add items for AVAH 2025-08-09 14:13:28 -07:00
main.py Rename 2025-08-10 10:11:37 -07:00
pyproject.toml main works, cli bugs 2025-06-15 22:20:59 -07:00
requirements.txt Add web-app 2025-08-09 21:32:21 -07:00
setup.py chore(release): v0.1.0 – initial public release of TradingAgents 2025-06-05 04:27:57 -07:00
uv.lock main works, cli bugs 2025-06-15 22:20:59 -07:00

README.md

TradingAgents: Multi-Agents LLM Financial Trading Framework

TradingAgents Framework

TradingAgents is a multi-agent trading framework that mirrors the dynamics of real-world trading firms. By deploying specialized LLM-powered agents: from fundamental analysts, sentiment experts, and technical analysts, to trader, risk management team, the platform collaboratively evaluates market conditions and informs trading decisions. Moreover, these agents engage in dynamic discussions to pinpoint the optimal strategy.

TradingAgents framework is designed for research purposes. Trading performance may vary based on many factors, including the chosen backbone language models, model temperature, trading periods, the quality of data, and other non-deterministic factors. It is not intended as financial, investment, or trading advice.

Our framework decomposes complex trading tasks into specialized roles. This ensures the system achieves a robust, scalable approach to market analysis and decision-making.

Analyst Team

  • Fundamentals Analyst: Evaluates company financials and performance metrics, identifying intrinsic values and potential red flags.
  • Sentiment Analyst: Analyzes social media and public sentiment using sentiment scoring algorithms to gauge short-term market mood.
  • News Analyst: Monitors global news and macroeconomic indicators, interpreting the impact of events on market conditions.
  • Technical Analyst: Utilizes technical indicators (like MACD and RSI) to detect trading patterns and forecast price movements.

Researcher Team

  • Comprises both bullish and bearish researchers who critically assess the insights provided by the Analyst Team. Through structured debates, they balance potential gains against inherent risks.

Trader Agent

  • Composes reports from the analysts and researchers to make informed trading decisions. It determines the timing and magnitude of trades based on comprehensive market insights.

Risk Management and Portfolio Manager

  • Continuously evaluates portfolio risk by assessing market volatility, liquidity, and other risk factors. The risk management team evaluates and adjusts trading strategies, providing assessment reports to the Portfolio Manager for final decision.
  • The Portfolio Manager approves/rejects the transaction proposal. If approved, the order will be sent to the simulated exchange and executed.

Installation and CLI

Installation

Clone TradingAgents:

git clone https://github.com/TauricResearch/TradingAgents.git
cd TradingAgents

Create a virtual environment in any of your favorite environment managers:

conda create -n tradingagents python=3.13
conda activate tradingagents

Install dependencies:

pip install -r requirements.txt

Required APIs

You will also need the FinnHub API for financial data. All of our code is implemented with the free tier.

export FINNHUB_API_KEY=$YOUR_FINNHUB_API_KEY

You will need the OpenAI API for all the agents.

export OPENAI_API_KEY=$YOUR_OPENAI_API_KEY

CLI Usage

You can also try out the CLI directly by running:

python -m cli.main

You will see a screen where you can select your desired tickers, date, LLMs, research depth, etc.

An interface will appear showing results as they load, letting you track the agent's progress as it runs.

TradingAgents Package

Implementation Details

We built TradingAgents with LangGraph to ensure flexibility and modularity. We utilize o1-preview and gpt-4o as our deep thinking and fast thinking LLMs for our experiments. However, for testing purposes, we recommend you use o4-mini and gpt-4.1-mini to save on costs as our framework makes lots of API calls.

Python Usage

Basic execution of the repository can be found in the following notebook.

For online_tools, we recommend enabling them for experimentation, as they provide access to real-time data. The agents' offline tools rely on cached data from our Tauric TradingDB, a curated dataset we use for backtesting. We're currently in the process of refining this dataset, and we plan to release it soon alongside our upcoming projects. Stay tuned!

You can view the full list of configurations in tradingagents/default_config.py.

Customization possibilities

Current Online tools

  • Market
  • Social
  • News
  • Fundamentals

Conditional Logic

There are strict rules for the number of loops for the conditional logic of the agents, customization is possible by including the human in the loop as part of the system prompt as the Research Manager / Risk Judge.