yahoo-finance / yahoo-finance

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

Problem with get_price(), even after the USD / COP market has opened #65

Open ma1onso opened 8 years ago

ma1onso commented 8 years ago

Hello, we’re experiencing an issue that you might help us clarify. When using the method get_price(), sometimes in the morning, even after the USD / COP market has opened, we still get the prior market day’s price, instead of the spot value. Is this something related to Yahoo’s service or is it something we might find a solution for?

Thanks

lukaszbanasiak commented 8 years ago

@alons45 thank you for creating a issue. Can you past here output with error traceback? That will help a lot.

ma1onso commented 8 years ago

@lukaszbanasiak i have not traceback error, the get_price() method not get real value for currency when market has open, compare with Yahoo Finance web page: https://finance.yahoo.com/quote/COP=X?p=COP=X

lukaszbanasiak commented 8 years ago

@alons45 Please remember that Yahoo Finance API is not real-time but delayed by 15 minutes

ma1onso commented 8 years ago

Hello again :smile: @lukaszbanasiak but my delay is one, two o three hours in the mornings :(.

conraddd commented 8 years ago

Same issue here, nearly half of the results from get_price() are price from previous day.

Code:

from yahoo_finance import Share import time yahoo = Share('AAPL') while True: yahoo.refresh() print yahoo.get_price(), yahoo.get_trade_datetime() time.sleep(5)

results:

112.52 2016-10-03 20:00:00 UTC+0000 112.52 2016-10-03 20:00:00 UTC+0000 113.05 2016-09-30 20:00:00 UTC+0000 112.52 2016-10-03 20:00:00 UTC+0000 113.05 2016-09-30 20:00:00 UTC+0000 113.05 2016-09-30 20:00:00 UTC+0000 112.52 2016-10-03 20:00:00 UTC+0000 112.52 2016-10-03 20:00:00 UTC+0000 113.05 2016-09-30 20:00:00 UTC+0000 112.52 2016-10-03 20:00:00 UTC+0000 112.52 2016-10-03 20:00:00 UTC+0000 112.52 2016-10-03 20:00:00 UTC+0000 112.52 2016-10-03 20:00:00 UTC+0000 113.05 2016-09-30 20:00:00 UTC+0000 112.52 2016-10-03 20:00:00 UTC+0000 112.52 2016-10-03 20:00:00 UTC+0000 112.52 2016-10-03 20:00:00 UTC+0000 113.05 2016-09-30 20:00:00 UTC+0000 113.05 2016-09-30 20:00:00 UTC+0000 113.05 2016-09-30 20:00:00 UTC+0000 113.05 2016-09-30 20:00:00 UTC+0000 112.52 2016-10-03 20:00:00 UTC+0000 112.52 2016-10-03 20:00:00 UTC+0000 113.05 2016-09-30 20:00:00 UTC+0000 113.05 2016-09-30 20:00:00 UTC+0000 112.52 2016-10-03 20:00:00 UTC+0000 112.52 2016-10-03 20:00:00 UTC+0000

Thanks

lukaszbanasiak commented 8 years ago

@conraddd I will made some additional tests, data are from Yahoo endpoint so that's very wired :)

trafiko commented 7 years ago

Hello @lukaszbanasiak - also having this same exact issue. Any updates on it? Tks! :)

perryism commented 7 years ago

It seems like the issue is from yahoo's end. https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20%3D%20%27aapl%27&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys