Commit Graph

17 Commits

Author SHA1 Message Date
Joseph O'Brien 85992fc05b chore: remove unused imports across codebase
Removed unused imports from 36 files including:
- Unused stdlib imports (json, time, re, os, signal, etc.)
- Unused typing imports (List, Dict, Optional, Tuple, Sequence, etc.)
- Unused langchain imports (AIMessage, ChatOpenAI, etc.)
- Unused langgraph imports (END, StateGraph, START, ToolNode, etc.)
- Unused project imports (DataLoader, get_config, parse_date, etc.)

Preserved intentional re-exports in:
- tradingagents/agents/utils/agent_utils.py (re-exports tool functions)
- tradingagents/dataflows/alpha_vantage.py (re-exports submodule functions)
- All __init__.py files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 04:44:37 -05:00
Joseph O'Brien f70874982a feat: add backtesting framework and fix code quality issues
- Add complete backtesting engine with portfolio simulation, metrics calculation
  (Sharpe, Sortino, max drawdown), and agent integration
- Add Pydantic data models for market data, trading, portfolio, and backtest results
- Add backtest CLI command with SMA, RSI, and hold strategies
- Fix 24+ bare exception handlers with specific exception types
- Fix hardcoded path in default_config.py (use TRADINGAGENTS_DATA_DIR env var)
- Fix unclosed file handle in local.py with context manager
- Disable store=True in OpenAI API calls for data privacy
- Fix typo: rename aggresive_debator.py to aggressive_debator.py
- Add request timeouts (30s) to alpha_vantage_common.py and googlenews_utils.py

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 02:55:28 -05:00
Joseph O'Brien 80e8fb0eee feat: add centralized logging module with dual output support
Add tradingagents/logging.py with JSONFormatter for structured file logs
and RichHandler for colored console output. Migrate 59 print statements
across 13 files to proper logger calls. Configure via environment
variables (TRADINGAGENTS_LOG_LEVEL, etc.) with default_config fallback.

- Rotating file handler: 10MB max, 5 backups to logs/tradingagents.log
- Rich console handler with tracebacks for development
- Logger hierarchy follows module paths (tradingagents.dataflows.*, etc.)
- 20 feature-specific tests covering core, config, migration, integration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 02:11:29 -05:00
Joseph O'Brien 24e955d29b Add Brave and Tavily news data vendors with retry handling
- Add Brave Search API integration for bulk news fetching
- Add Tavily API integration for bulk news fetching
- Implement timeout and retry logic with exponential backoff for both vendors
- Make bulk news vendor order configurable via default_config.py
- Add tavily-python to requirements.txt
- Document BRAVE_API_KEY and TAVILY_API_KEY in .env.example and README
- Add comprehensive unit tests for both vendors (49 tests)

The news discovery system now uses fallback chain: Tavily → Brave → Alpha Vantage → OpenAI → Google

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 00:43:27 -05:00
Joseph O'Brien 43e7d98ff1 Update interface.py 2025-12-02 20:40:56 -05:00
Joseph O'Brien 3f6b1e9f39 Add trending stock discovery feature
Implement a multi-stage pipeline to discover trending stocks from news:
- Entity extraction from news articles using LLM
- Stock ticker resolution via Yahoo Finance
- Sector classification and event categorization
- Scoring algorithm based on mentions, sentiment, and recency
- CLI integration with interactive stock selection and analysis flow
- Persistence layer for saving discovery results
- Comprehensive test suite for all discovery components

Update README with uv-based installation instructions and remove emojis.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 20:19:34 -05:00
Edward Sun c07dcf026b added fallbacks for tools 2025-10-03 22:40:09 -07:00
luohy15 b01051b9f4 Switch default data vendor
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-30 12:43:27 +08:00
luohy15 8b04ec307f minor fix 2025-09-26 23:25:33 +08:00
luohy15 0ab323c2c6 Add Alpha Vantage API integration as primary data provider
- Replace FinnHub with Alpha Vantage API in README documentation
- Implement comprehensive Alpha Vantage modules:
  - Stock data (daily OHLCV with date filtering)
  - Technical indicators (SMA, EMA, MACD, RSI, Bollinger Bands, ATR)
  - Fundamental data (overview, balance sheet, cashflow, income statement)
  - News and sentiment data with insider transactions
- Update news analyst tools to use ticker-based news search
- Integrate Alpha Vantage vendor methods into interface routing
- Maintain backward compatibility with existing vendor system

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-26 22:57:50 +08:00
luohy15 a6734d71bc WIP 2025-09-26 16:17:50 +08:00
Max Wong 43aa9c5d09
Local Ollama (#53)
- Fix typo 'Start' 'End'
- Add llama3.1 selection
- Use 'quick_think_llm' model instead of hard-coding GPT
2025-06-26 00:27:01 -04:00
Edward Sun da84ef43aa main works, cli bugs 2025-06-15 22:20:59 -07:00
Edward Sun 90b23e72f5
Merge pull request #25 from maxer137/main
Add support for other backends, such as OpenRouter and Ollama
2025-06-15 16:06:20 -07:00
saksham0161 570644d939
Fix ticker hardcoding in prompt (#28) 2025-06-11 19:43:39 -07:00
maxer137 99789f9cd1 Add support for other backends, such as OpenRouter and olama
This aims to offer alternative OpenAI capable api's.
This offers people to experiment with running the application locally
2025-06-11 14:19:25 +02:00
Yijia-Xiao cc97cb6d5d chore(release): v0.1.0 – initial public release of TradingAgents 2025-06-05 04:27:57 -07:00