Skip to content

Bug: batch_get_prices passes no date range — silently returns ~20 rows instead of years of history #54

Description

@bradsmithmba

Summary

YFinanceProvider.batch_get_prices calls self.get_price_history(symbol) with no start, end, or period arguments. yfinance defaults to 1 month of daily data (~20 rows). Feature calculators that require 252+ rows (ADX, Bollinger, _rolling_rank with window=252) receive an undersized frame and produce mostly-NaN features. No warning or error is raised.

Evidence

src/data/providers.py lines 132-139:

def batch_get_prices(self, symbols):
    for symbol in symbols:
        results[symbol] = self.get_price_history(symbol)  # no period/start/end

get_price_history signature: (symbol, start=None, end=None, interval="1d"). Default yfinance period when all are None: 1 month.

Fix

Pass a default period covering at least 2 years: self.get_price_history(symbol, start=two_years_ago), or add a days parameter to batch_get_prices that mirrors the single-fetch API.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions