JECSand / yahoofinancials

A powerful financial data module used for pulling data from Yahoo Finance. This module can pull fundamental and technical data for stocks, indexes, currencies, cryptos, ETFs, Mutual Funds, U.S. Treasuries, and commodity futures.
https://pypi.python.org/pypi/yahoofinancials
MIT License
911 stars 215 forks source link

terminated symbols do not work #12

Closed Iarwa1n closed 6 years ago

Iarwa1n commented 6 years ago

First of all, thanks for your great library. But I ran into a problem today:

I wanted to download historical data for the ticker symbol VRX, which does not work. This code belonged to Valeant Pharmaceuticals International, Inc. which is now called Bausch Health Companies Inc. (VRX.SW). But the symbol VRX.SW does not give me historical data for the original company. The data is still there (https://finance.yahoo.com/quote/VRX/history?p=VRX) but the code does not work with your library.

JECSand commented 6 years ago

Thank you for posting!

I attempted to recreate this issue, but didn't seem to be able to. Can you tell me which version of YF you are using and what your code looked like?

Using v1.2 I tried running:

stocka = 'VRX'
stockb = 'VRX.SW'

yahoo_financials_a = YahooFinancials(stocka)
yahoo_financials_b = YahooFinancials(stockb)

print(yahoo_financials_a.get_historical_price_data('2018-01-18', '2019-09-01', 'Daily'))
print(yahoo_financials_a.get_financial_stmts('quarterly', 'balance'))
print(yahoo_financials_b.get_historical_price_data('2018-01-18', '2019-09-01', 'Daily'))
print(yahoo_financials_b.get_financial_stmts('quarterly', 'balance'))

It appeared to return the correct data.

Let me know if I am missing something.

Thanks!

JECSand commented 6 years ago

I'm closing this issue since I have not heard from the OP in a week and have been unable to replicate the bug using v1.2. If anyone is still experiencing this bug please feel free to open a new issue telling me the versions of YF and python you are running. Also providing me with a sample of the code you are trying to run will help significantly.

Thanks again for using YahooFinancials!!