Commit Graph

4 Commits

Author SHA1 Message Date
Joseph O'Brien c39f9aab36 Add pre-commit hooks and ruff code quality configuration
- Add .pre-commit-config.yaml with trailing whitespace, ruff linter/formatter
- Configure ruff in pyproject.toml with selected rules (E, F, W, I, UP, B, C4, SIM)
- Add F401 to unfixable to preserve re-exported imports in __init__.py files
- Fix BacktestMetrics import in backtesting/engine.py
- Update todos.md with enhanced trade discovery and database implementation tasks

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 11:22:13 -05:00
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 1346e20b5e feat: create enums for status strings
Added AgentStatus enum for CLI agent tracking (pending, in_progress,
completed, error) and BacktestStatus enum for backtest results (pending,
running, completed, failed). Replaces string literals with type-safe
enum values throughout the codebase.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 04:13:59 -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