Commit Graph

10 Commits

Author SHA1 Message Date
Joseph O'Brien 9c252fdc2c refactor: consolidate configuration management with Pydantic-based settings
- Add tradingagents/config.py with TradingAgentsSettings Pydantic model
- Centralize all environment variable handling and API key management
- Add validation for log_level, llm_provider, and numeric bounds
- Update dataflows/config.py to use central config as backend
- Update logging.py to get settings from central config
- Update API key access in alpha_vantage, brave, and tavily modules
- Replace DEFAULT_CONFIG imports with get_config() calls
- Add 20 comprehensive tests for config module

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 03:20:41 -05:00
Joseph O'Brien eba9048b5a test: add comprehensive integration tests for agent workflow
Add 47 integration tests covering:
- Agent state structures (InvestDebateState, RiskDebateState, AgentState)
- Conditional logic for analyst tool calls and debate flow
- Propagator state initialization and configuration
- Graph setup with various analyst combinations
- End-to-end workflow state transitions
- Validation integration with TradingAgentsGraph

Tests verify:
- State creation and mutation
- Debate round progression (Bull/Bear, Risk analysts)
- Graph compilation with different analyst configurations
- Input validation for tickers and dates

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 03:14:03 -05:00
Joseph O'Brien e862c4f803 feat: add centralized input validation for ticker symbols and dates
- Create tradingagents/validation.py with comprehensive validation functions:
  - validate_ticker/validate_tickers for ticker symbol validation
  - validate_date/validate_date_range for date validation
  - parse_date for flexible date parsing (multiple formats)
  - Helper functions: is_valid_ticker, is_valid_date, is_trading_day
  - get_previous_trading_day, get_next_trading_day utilities
- Add validation to y_finance.py (get_YFin_data_online, get_stock_stats_indicators_window)
- Add validation to trading_graph.py propagate method
- Create comprehensive test suite (55 tests) in tests/test_validation.py

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 03:09:05 -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
coderabbitai[bot] 0ca7478c4b
CodeRabbit Generated Unit Tests: Add comprehensive test suite with 142+ unit tests 2025-12-03 01:33:37 +00: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
Yijia Xiao 26c5ba5a78
Revert "Docker support and Ollama support (#47)" (#57)
This reverts commit 78ea029a0b.
2025-06-26 00:07:58 -04:00
Geeta Chauhan 78ea029a0b
Docker support and Ollama support (#47)
- Added support for running CLI and Ollama server via Docker
- Introduced tests for local embeddings model and standalone Docker setup
- Enabled conditional Ollama server launch via LLM_PROVIDER
2025-06-25 23:57:05 -04:00