phidata icon indicating copy to clipboard operation
phidata copied to clipboard

YFinanceTools().get_historical_stock_prices returns only one datapoint

Open rawmean opened this issue 9 months ago • 3 comments

To test, do this and observe that only one datapoint is returns (instead of the default which should be daily for one month). I also tried different values for period and interval parameters.

data = YFinanceTools().get_historical_stock_prices(symbol="NVDA")  
print(data)

rawmean avatar May 16 '24 23:05 rawmean

#308

rawmean avatar May 17 '24 00:05 rawmean

Thanks for the PR @rawmean. Sometimes the LLM would request historical data across a long interval (5 years+) exceeding the context window of some of the smaller models. But happy to test this and set some checks to avoid that.

ysolanky avatar May 17 '24 01:05 ysolanky

Thanks. 5+ years interval may not be necessarily large if the period is set to 1mo as an example. If you insist on putting a check, maybe the check should be on number of samples and not the "interval".

rawmean avatar May 17 '24 01:05 rawmean