yfinance icon indicating copy to clipboard operation
yfinance copied to clipboard

Add Potential Market Closure Error

Open R5dan opened this issue 10 months ago • 5 comments

I want to add an error for when there is no data as the market is closed

Currently I have:

  • Ticker contains its current Market
  • Market now contains it name in the class

However I was going to implement this with the Maket.status but that doesn't have any way to get a custom time / date.

R5dan avatar Feb 20 '25 01:02 R5dan

Just FYI history_metadata contains exchange hours, maybe only for intraday intervals.

ValueRaider avatar Feb 20 '25 22:02 ValueRaider

Yes, I know. That was another that I looked at, and will just implement this type of erroring if you want. I was kind of looking for market holidays as well. What do you think? @ValueRaider

R5dan avatar Feb 20 '25 22:02 R5dan

https://pypi.org/project/holidays

ValueRaider avatar Feb 20 '25 22:02 ValueRaider

I did not know about that, thanks

R5dan avatar Feb 20 '25 22:02 R5dan

@ValueRaider This seemed to be ideal, however they only support 7 markets, making it unfeasible to use.

R5dan avatar Feb 21 '25 17:02 R5dan