Commit Graph

7 Commits

Author SHA1 Message Date
Claude Lab abd13c0153 fix: prevent look-ahead bias in backtesting data fetchers
Closes #203

Data fetch functions were using today's date as the end bound instead of
the simulation's curr_date, allowing future data to leak into backtests.

Changes:
- stockstats_utils.py: replace pd.Timestamp.today() with curr_date + 1 day
- y_finance.py _get_stock_stats_bulk: same fix for yfinance OHLCV download
- y_finance.py get_balance_sheet/get_cashflow/get_income_statement: filter
  out fiscal periods whose column timestamp exceeds curr_date
- alpha_vantage_fundamentals.py get_balance_sheet/get_cashflow/get_income_statement:
  filter annualReports and quarterlyReports by fiscalDateEnding <= curr_date
- yfinance_news.py get_global_news_yfinance: skip articles with pub_date
  after curr_date

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 19:38:46 +01: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 3d040f8da4
feat: add yfinance support to accommodate community request for stability and quota 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 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