yahoo-finance / yahoo-finance

Python module to get stock data from Yahoo! Finance
1.35k stars 355 forks source link

get_price() function returning hours old quote #114

Open wpr101 opened 7 years ago

wpr101 commented 7 years ago

Hey, I am using the get_price() function on a number of different stocks, and it seems the quotes returned are sometimes old, as in a price from hours before.

One symbol in question it did this for was 'ESPR'.

I have tried calling the get_trade_datetime() as a loop through my list of quotes that I need, and often they have much different time stamps. Is this get_trade_datetime, showing the time of the last trade, or am I misunderstanding that functionality?

Thank you.

fschr commented 7 years ago

Can you provide some specific examples? I assume get_price gets the most recent price available.

wpr101 commented 7 years ago

I was looping through a list of about 200 quotes. As I went through the quotes versus the actual current prices, many of the prices were drastically different which was how I discovered this.

On that example stock mentioned 'ESPR', I was getting the quote at 11am yesterday when the price was around 24.6. The get_price function was returning prices like 21.56 though which were prices appearing to be at 9:30AM. As I tested more the get_price was returning higher prices like 22 point something. So it looks like for some stocks it was returning hour and half late quotes.

By the way, I am testing from Europe time zone where they haven't had daylight savings yet. I was thinking maybe it was reading from the local clock somehow?

fschr commented 7 years ago

It could be a local/universal time mix up. I'll look into this.