jeffreywallphd / AutoProphet

A repository for code and documentation for the open-source Auto Prophet financial analytics tool
GNU General Public License v3.0
6 stars 4 forks source link

Yahoo Finance Stock Gateway Intraday Bug #102

Open jeffreywallphd opened 2 months ago

jeffreywallphd commented 2 months ago

Describe the bug When you use the Stock & Fund area to view intraday data, the Yahoo Finance data would not allow the start data and end date to be the same day. So, the start date is the previous day and the end date is the current day. This adds extra marks on the x-axis that are being filled in with data for the chart. The volume data does not appear to do the same.

To Reproduce Steps to reproduce the behavior:

  1. Go to Stock & Fund
  2. Type a ticker, such a "F" in the search bar and select it from the dropdown
  3. The chart will show a longer time period than the trading day with the chart covering the entire period despite the market being closed for some of these hours.
  4. The volume bar chart show a volume of 0 during these hours as it should.

Expected behavior A clear and concise description of what you expected to happen: The time series chart should not show data outside of market hours.

Screenshots If applicable, add screenshots to help explain your problem:

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

jeffreywallphd commented 2 months ago

I added a recent bug fix for another YFinance bug. The YFinance API should now be pulling data for the current day starting a 9:30am to 4:00pm (i.e., the stock market regular hours). Although this may fix parts of the bug, it may also cause issues when someone tries to view stock market data at 9:00 am before the market opens. We will need to add a fix in the YFinanceStockGateway that looks to the previous days date (or the previous Friday if Monday at 9:00 am.

jeffreywallphd commented 2 months ago

Although I did not confirm that viewing the page before 9:30am causes an issue, I did note that the intraday data for Ford at 9:45am today was strange. It may have a data value set to zero, which is causing the AreaChart to have a much larger range than needed. This makes the line appear relatively flat for the 15 minutes of data that was available. A fix needs to be issued to make the Yahoo Finance intraday data show the min of the chart as the lowest non-zero data value. Adding the market start and end time did fix the issue of extra strange data being included.