Plan updates to README.md

This commit is contained in:
Patron 2025-11-09 15:55:56 -08:00
parent 0631a4f04f
commit fc29f09f48
1 changed files with 81 additions and 71 deletions

152
README.md
View File

@ -1,69 +1,54 @@
<p align="center">
<img src="assets/TauricResearch.png" style="width: 60%; height: auto;">
</p>
<div align="center" style="line-height: 1;">
<a href="https://arxiv.org/abs/2412.20138" target="_blank"><img alt="arXiv" src="https://img.shields.io/badge/arXiv-2412.20138-B31B1B?logo=arxiv"/></a>
<a href="https://discord.com/invite/hk9PGKShPK" target="_blank"><img alt="Discord" src="https://img.shields.io/badge/Discord-TradingResearch-7289da?logo=discord&logoColor=white&color=7289da"/></a>
<a href="./assets/wechat.png" target="_blank"><img alt="WeChat" src="https://img.shields.io/badge/WeChat-TauricResearch-brightgreen?logo=wechat&logoColor=white"/></a>
<a href="https://x.com/TauricResearch" target="_blank"><img alt="X Follow" src="https://img.shields.io/badge/X-TauricResearch-white?logo=x&logoColor=white"/></a>
<br>
<a href="https://github.com/TauricResearch/" target="_blank"><img alt="Community" src="https://img.shields.io/badge/Join_GitHub_Community-TauricResearch-14C290?logo=discourse"/></a>
</div>
<div align="center">
<!-- Keep these links. Translations will automatically update with the README. -->
<a href="https://www.readme-i18n.com/TauricResearch/TradingAgents?lang=de">Deutsch</a> |
<a href="https://www.readme-i18n.com/TauricResearch/TradingAgents?lang=es">Español</a> |
<a href="https://www.readme-i18n.com/TauricResearch/TradingAgents?lang=fr">français</a> |
<a href="https://www.readme-i18n.com/TauricResearch/TradingAgents?lang=ja">日本語</a> |
<a href="https://www.readme-i18n.com/TauricResearch/TradingAgents?lang=ko">한국어</a> |
<a href="https://www.readme-i18n.com/TauricResearch/TradingAgents?lang=pt">Português</a> |
<a href="https://www.readme-i18n.com/TauricResearch/TradingAgents?lang=ru">Русский</a> |
<a href="https://www.readme-i18n.com/TauricResearch/TradingAgents?lang=zh">中文</a>
### 📌 **Note:** This repository is a fork of the original [TradingAgents](https://github.com/TauricResearch/TradingAgents) repository from the paper "TradingAgents: Multi-Agents LLM Financial Trading Framework" ([arXiv:2412.20138](https://arxiv.org/abs/2412.20138)). This fork implements **FinAgents**, an extension that integrates a domain-adapted language model (FinLLaMA+) to enhance sentiment analysis and improve trading performance.
</div>
---
# TradingAgents: Multi-Agents LLM Financial Trading Framework
# FinAgents: Multi-Agent Financial Trading with Domain-Adapted Language Models
> 🎉 **TradingAgents** officially released! We have received numerous inquiries about the work, and we would like to express our thanks for the enthusiasm in our community.
>
> So we decided to fully open-source the framework. Looking forward to building impactful projects with you!
<div align="center">
<a href="https://www.star-history.com/#TauricResearch/TradingAgents&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=TauricResearch/TradingAgents&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=TauricResearch/TradingAgents&type=Date" />
<img alt="TradingAgents Star History" src="https://api.star-history.com/svg?repos=TauricResearch/TradingAgents&type=Date" style="width: 80%; height: auto;" />
</picture>
</a>
</div>
> **FinAgents** extends the TradingAgents framework by integrating **FinLLaMA+**, a fine-tuned version of Llama 3.18B trained via LoRA on financial filings, earnings calls, and labeled sentiment datasets. This domain-adapted model provides ticker-grounded, confidence-calibrated sentiment embeddings that enhance textual reasoning and improve decision precision in multi-agent trading systems.
<div align="center">
🚀 [TradingAgents](#tradingagents-framework) | ⚡ [Installation & CLI](#installation-and-cli) | 🎬 [Demo](https://www.youtube.com/watch?v=90gr5lwjIho) | 📦 [Package Usage](#tradingagents-package) | 🤝 [Contributing](#contributing) | 📄 [Citation](#citation)
🚀 [FinAgents Framework](#finagents-framework) | ⚡ [Installation](#installation-and-cli) | 🎬 [Demo](https://www.youtube.com/watch?v=90gr5lwjIho) | 📦 [Package Usage](#tradingagents-package) | 🤝 [Contributing](#contributing) | 📄 [Citation](#citation)
</div>
## TradingAgents Framework
## FinAgents 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.
FinAgents extends the TradingAgents multi-agent trading framework, which mirrors the dynamics of real-world trading firms. By deploying specialized LLM-powered agents—from fundamental analysts, sentiment experts, and technical analysts, to trader and risk management teams—the platform collaboratively evaluates market conditions and informs trading decisions. These agents engage in dynamic discussions to pinpoint the optimal strategy.
### Key Enhancements
**FinLLaMA+ Integration**: The framework integrates a domain-adapted language model (FinLLaMA+) that replaces the generic sentiment analysis used in the original TradingAgents. This enhancement includes:
- **Domain-Adaptive Pretraining (DAPT)**: Pre-training on earnings call transcripts (~304M tokens) to improve financial language understanding, achieving a 22.52% reduction in perplexity
- **Supervised Fine-Tuning (SFT)**: Fine-tuning on Financial PhraseBank and SemEval-2017 Task 5 datasets (~6,000 labeled examples) for sentiment classification
- **Ticker-Grounded Sentiment Analysis**: Produces structured JSON outputs with sentiment polarity, confidence scores, and relevance metrics
- **Confidence-Weighted Aggregation**: Aggregates multiple news items into daily sentiment scores using confidence-weighted means
### Project Team
- **Vaibhav Dhanuka** ([vdhanuka@wisc.edu](mailto:vdhanuka@wisc.edu)) - Infrastructure, LLM training, evaluation
- **Negi Shashwat** ([negi3@wisc.edu](mailto:negi3@wisc.edu)) - LLM fine-tuning, agent coordination, system design
- **Zichen Liu** ([zliu2263@wisc.edu](mailto:zliu2263@wisc.edu)) - Data collection/preprocessing, pipelines
- **Quanliang Liu** ([qliu388@wisc.edu](mailto:qliu388@wisc.edu)) - Backtesting, visualization, performance
<p align="center">
<img src="assets/schema.png" style="width: 100%; height: auto;">
</p>
> 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.](https://tauric.ai/disclaimer/)
> 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.
- **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**: Enhanced with FinLLaMA+ for domain-specialized sentiment analysis. Monitors global news and macroeconomic indicators, interpreting the impact of events on market conditions with improved financial language understanding.
- **Technical Analyst**: Utilizes technical indicators (like MACD and RSI) to detect trading patterns and forecast price movements.
<p align="center">
<img src="assets/analyst.png" width="100%" style="display: inline-block; margin: 0 2%;">
@ -95,7 +80,13 @@ Our framework decomposes complex trading tasks into specialized roles. This ensu
### Installation
Clone TradingAgents:
Clone this fork:
```bash
git clone <YOUR_REPO_URL>
cd TradingAgents
```
Or clone the original repository:
```bash
git clone https://github.com/TauricResearch/TradingAgents.git
cd TradingAgents
@ -127,29 +118,7 @@ cp .env.example .env
# Edit .env with your actual API keys
```
**Note:** We are happy to partner with Alpha Vantage to provide robust API support for TradingAgents. You can get a free AlphaVantage API [here](https://www.alphavantage.co/support/#api-key), TradingAgents-sourced requests also have increased rate limits to 60 requests per minute with no daily limits. Typically the quota is sufficient for performing complex tasks with TradingAgents thanks to Alpha Vantages open-source support program. If you prefer to use OpenAI for these data sources instead, you can modify the data vendor settings in `tradingagents/default_config.py`.
### CLI Usage
You can also try out the CLI directly by running:
```bash
python -m cli.main
```
You will see a screen where you can select your desired tickers, date, LLMs, research depth, etc.
<p align="center">
<img src="assets/cli/cli_init.png" width="100%" style="display: inline-block; margin: 0 2%;">
</p>
An interface will appear showing results as they load, letting you track the agent's progress as it runs.
<p align="center">
<img src="assets/cli/cli_news.png" width="100%" style="display: inline-block; margin: 0 2%;">
</p>
<p align="center">
<img src="assets/cli/cli_transaction.png" width="100%" style="display: inline-block; margin: 0 2%;">
</p>
**Note:** We are happy to partner with Alpha Vantage to provide robust API support for TradingAgents. You can get a free AlphaVantage API [here](https://www.alphavantage.co/support/#api-key), TradingAgents-sourced requests also have increased rate limits to 60 requests per minute with no daily limits. Typically the quota is sufficient for performing complex tasks with TradingAgents thanks to Alpha Vantage's open-source support program. If you prefer to use OpenAI for these data sources instead, you can modify the data vendor settings in `tradingagents/default_config.py`.
## TradingAgents Package
@ -200,17 +169,50 @@ _, decision = ta.propagate("NVDA", "2024-05-10")
print(decision)
```
> The default configuration uses yfinance for stock price and technical data, and Alpha Vantage for fundamental and news data. For production use or if you encounter rate limits, consider upgrading to [Alpha Vantage Premium](https://www.alphavantage.co/premium/) for more stable and reliable data access. For offline experimentation, there's a local data vendor option that uses our **Tauric TradingDB**, a curated dataset for backtesting, though this is still in development. We're currently refining this dataset and plan to release it soon alongside our upcoming projects. Stay tuned!
> The default configuration uses yfinance for stock price and technical data, and Alpha Vantage for fundamental and news data. For production use or if you encounter rate limits, consider upgrading to [Alpha Vantage Premium](https://www.alphavantage.co/premium/) for more stable and reliable data access. For offline experimentation, there's a local data vendor option available, though this is still in development.
You can view the full list of configurations in `tradingagents/default_config.py`.
## FinLLaMA+ Model Details
### Training Pipeline
1. **Domain-Adaptive Pretraining (DAPT)**
- Base model: Llama 3.18B
- Dataset: Earnings call transcripts (~304M tokens, 20% of full dataset)
- Method: QLoRA with 4-bit NF4 quantization
- Training: 1 epoch on NVIDIA A40 GPU (~6 days)
- Result: 22.52% perplexity reduction (6.4076 → 4.9649)
2. **Supervised Fine-Tuning (SFT)**
- Datasets: Financial PhraseBank + SemEval-2017 Task 5 (~6,000 examples)
- Task: Sentiment classification (positive/neutral/negative/uncertain)
- Method: LoRA (rank r=16, α=32, dropout=0.05)
- Output: Structured JSON with sentiment, confidence, and relevance scores
### Integration Architecture
FinLLaMA+ serves as a drop-in replacement for the News and Social Sentiment agents. It processes financial news and social media updates, producing structured outputs that are aggregated into daily sentiment scores per ticker. The model includes:
- **Caching and Deduplication**: Content hash-based caching and embedding similarity filtering to reduce redundant LLM calls
- **Relevance Scoring**: Hybrid semantic similarity and keyword matching to prioritize ticker-specific news
- **Market Sentiment Reports**: Generates interpretable narrative summaries for the Researcher Team
## Evaluation Metrics
Performance is evaluated using standard financial metrics:
- **Cumulative Return (CR)**: Total portfolio return over the evaluation period
- **Annualized Return (AR)**: Return normalized to an annual basis
- **Sharpe Ratio (SR)**: Risk-adjusted return metric
- **Maximum Drawdown (MDD)**: Largest peak-to-trough decline
## Contributing
We welcome contributions from the community! Whether it's fixing a bug, improving documentation, or suggesting a new feature, your input helps make this project better. If you are interested in this line of research, please consider joining our open-source financial AI research community [Tauric Research](https://tauric.ai/).
This is a fork implementing FinAgents extensions to the TradingAgents framework. For contributions to the original TradingAgents project, please refer to the [original repository](https://github.com/TauricResearch/TradingAgents).
## Citation
Please reference our work if you find *TradingAgents* provides you with some help :)
### Original TradingAgents Paper
```
@misc{xiao2025tradingagentsmultiagentsllmfinancial,
@ -223,3 +225,11 @@ Please reference our work if you find *TradingAgents* provides you with some hel
url={https://arxiv.org/abs/2412.20138},
}
```
### Related Works
This project builds upon several key papers:
- **FinBERT** (Araci, 2019): Domain-specific transformers for finance
- **FinLLaMA** (Konstantinidis et al., 2024): Financial sentiment classification
- **Trading-R1** (Xiao et al., 2025a): Reinforcement learning for trading
- **ElliottAgents** (Wawer & Chudziak, 2025): Multi-agent LLM-based forecasting