Commit Graph

30 Commits

Author SHA1 Message Date
Johnny 7ea1bd4c0b
Merge f7f0aa0678 into fa4d01c23a 2026-04-14 11:47:05 +00:00
Yijia-Xiao 28d5cc661f
fix: add missing pandas import in y_finance.py (#488) 2026-04-04 07:14:10 +00:00
Yijia-Xiao f3f58bdbdc
fix: add yf_retry to yfinance news fetchers (#445) 2026-03-29 17:42:24 +00:00
Yijia-Xiao e1113880a1
fix: prevent look-ahead bias in backtesting data fetchers (#475) 2026-03-29 17:34:35 +00:00
John Weston f7f0aa0678 Address Gemini round 6: fix indicator fallback, consistent _safe_get usage
HIGH: Unknown indicator now returns clear error with supported list instead of
  silently falling back to technicals() which has a different response structure
MEDIUM: Use _safe_get consistently in get_sentiment_score (was data.get)
2026-03-23 19:05:23 -04:00
John Weston 7850413348 Address Gemini round 5: date validation, cashflow consistency, clean CSV values
MEDIUM: Validate start_date < end_date (return error instead of large API call)
MEDIUM: get_cashflow returns tabular format when available, matching other vendors
MEDIUM: Remove formatting chars from CSV data (no $ or % in values)
2026-03-23 18:46:16 -04:00
John Weston 435854e5a6 Address Gemini round 4: register get_technicals, fix curr_date, clean up naming
HIGH: Add get_technicals to TOOLS_CATEGORIES (was unregistered)
HIGH: Use curr_date param in get_indicators for historical range calculation
HIGH: Remove misleading get_insider_transactions alias — keep separate:
  - get_insider_transactions: yfinance/AV (actual insider trades, Form 4)
  - get_sec_filings: Polaris (earnings filings, 8-K/10-Q/10-K)
MEDIUM: Simplify _extract_briefs helper
2026-03-23 18:16:21 -04:00
John Weston 7e3516e400 Address all Gemini round 3 feedback
HIGH: Remove cachetools fallback — require it directly (it's in requirements.txt)
HIGH: Fix get_global_news — return empty result instead of unfiltered fallback
HIGH: Fail fast if POLARIS_API_KEY not set (no silent 'demo' fallback)

MEDIUM: Merge get_competitors into get_sector_analysis (remove duplication)
MEDIUM: Extract _extract_briefs() and _format_brief_detail() shared helpers
MEDIUM: Add trailing newline to get_news for consistency
MEDIUM: All .get() calls use _safe_get with proper defaults
2026-03-23 18:00:50 -04:00
John Weston b622630e53 Address Gemini review: date filtering, caching, dedup, naming + add technicals & competitors
Fixes all 9 Gemini issues:
- HIGH: get_news/get_global_news now pass start_date/end_date to API
- HIGH: get_sec_filings (renamed from get_insider_transactions) has caching
- MEDIUM: Replaced _get2 duplicate with shared _safe_get at module level
- MEDIUM: _safe_get returns default instead of None (no more 'None' in strings)
- MEDIUM: balance_sheet/cashflow/income_statement now cache formatted results
- MEDIUM: String concatenation replaced with list join pattern throughout
- MEDIUM: _days_to_range helper eliminates range calculation duplication
- MEDIUM: Fallback for unknown indicator types formats dict keys as CSV

New Polaris-exclusive methods:
- get_technicals: 20 indicators + buy/sell signal in one call
- get_competitors: same-sector peers with live price, RSI, sentiment
2026-03-23 17:49:46 -04:00
John Weston 4abad33e0f Add Polaris as news/sentiment/price data vendor
Adds Polaris Knowledge API as a third data vendor alongside yfinance and
Alpha Vantage. Polaris provides sentiment-scored intelligence, composite
trading signals, and news impact analysis that raw data feeds don't offer.

Implements all existing vendor methods plus 3 Polaris-exclusive methods
(sentiment_score, sector_analysis, news_impact).

Uses cachetools.TTLCache for thread-safe caching, shared financials fetch
to avoid redundant API calls, and polaris-news SDK for all API access.

Tested with real API calls — all functions return valid data.
Addresses #305, #11, #86.
2026-03-23 09:12:06 -04:00
Yijia-Xiao 7cca9c924e fix: add exponential backoff retry for yfinance rate limits (#426) 2026-03-22 22:11:08 +00:00
Yijia-Xiao b0f9d180f9 fix: harden stock data parsing against malformed CSV and NaN values
Add _clean_dataframe() to normalize stock DataFrames before stockstats:
coerce invalid dates/prices, drop rows missing Close, fill price gaps.
Also add on_bad_lines="skip" to all cached CSV reads.
2026-03-15 18:29:43 +00:00
Yijia Xiao 102b026d23
refactor: clean up codebase and streamline documentation
- Remove debug prints from vendor routing (interface.py)
- Simplify vendor fallback to only handle rate limits
- Reorder CLI provider menu: OpenAI, Google, Anthropic, xAI, OpenRouter, Ollama
- Remove dead files: local.py, reddit_utils.py, openai.py, google.py, googlenews_utils.py, yfin_utils.py
2026-02-03 22:27:20 +00:00
Yijia Xiao b06936f420
fix: improve data vendor implementations and tool signatures
- Add get_global_news for Alpha Vantage
- Fix get_insider_transactions signature (remove unused curr_date param)
- Remove unnecessary default params from API calls (sort, limit, tab)
2026-02-03 22:27:20 +00:00
Yijia Xiao 3d040f8da4
feat: add yfinance support to accommodate community request for stability and quota 2026-02-03 22:27:20 +00:00
Yijia Xiao d4dadb82fc
feat: add multi-provider LLM support with thinking configurations
Models added:
- OpenAI: GPT-5.2, GPT-5.1, GPT-5, GPT-5 Mini, GPT-5 Nano, GPT-4.1
- Anthropic: Claude Opus 4.5/4.1, Claude Sonnet 4.5/4, Claude Haiku 4.5
- Google: Gemini 3 Pro/Flash, Gemini 2.5 Flash/Flash Lite
- xAI: Grok 4, Grok 4.1 Fast (Reasoning/Non-Reasoning)

Configs updated:
- Add unified thinking_level for Gemini (maps to thinking_level for Gemini 3,
  thinking_budget for Gemini 2.5; handles Pro's lack of "minimal" support)
- Add OpenAI reasoning_effort configuration
- Add NormalizedChatGoogleGenerativeAI for consistent response handling

Fixes:
- Fix Bull/Bear researcher display truncation
- Replace ChromaDB with BM25 for memory retrieval
2026-02-03 22:27:20 +00:00
Edward Sun 7bb2941b07 optimized yfin fetching to be much faster 2025-10-06 19:58:01 -07:00
Edward Sun c07dcf026b added fallbacks for tools 2025-10-03 22:40:09 -07:00
luohy15 d23fb539e9 minor fix 2025-09-30 13:27:48 +08: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 6211b1132a Improve Alpha Vantage indicator column parsing with robust mapping
- Replace hardcoded column indices with column name lookup
- Add mapping for all supported indicators to their expected CSV column names
- Handle missing columns gracefully with descriptive error messages
- Strip whitespace from header parsing for reliability

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-26 23:36:36 +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