-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
key.ratios for non-us exchanges #26
Comments
Also, is the "region" information necessary in the request url? Both of the two links work: one is for region = CHN, and the other is for region = USA |
Great question, and the short answer is Yes! We are evaluating Morningstar for both key ratios and financials. Key ratios are already implemented, but as you point out the implementation could be improved by adding additional arguments such as region to allow the user a more flexible data retrieval. For financials, we are evaluating the change from Google Finance to Morningstar, and allowing the user the flexibility to select statement_type, value_type, etc to make it more flexible and even more useful. I'll leave this as an open issue until we implement the feature improvements. This way you'll be notified when the development version has the features incorporated. |
Thank you Matt. |
I have a similar problem with german stocks. e.g. Volkswagen have the url: http://financials.morningstar.com/valuation/price-ratio.html?t=XETR:VOW®ion=DEU However: AND: tq_get("XETR:VOW", get = "key.ratios") Do you have a solution how to get these key.ratios? |
Thanks for the heads up on this. I'll add this to the mix as well. I believe there's a solution to key in on the colon during the download and to handle the errors more gracefully. |
I was looking at some european stocks and ran into this limitation as well. My preliminary change is here: mwaldstein@3812ae4 I took a stab at allowing arbitrary exchange sources, but a lot of the later code is hard coded to USD for calculated ratios - e.g. historic P/E It might be a good idea to split the "raw" key ratios fetched from morning star from the calculated ratios, at least as an intermediate step allowing the user to get the core data while the other components wait on a more robust solution to manage different currencies. |
Just took a look at the code, and it looks great. I'd like to test it out though when I get a minute. We have a few things going on this week, but we'll be definitely including this improvement in the next major version coming soon. |
My code is pretty unsafe right now (and is why I didn't put in a pull request) - For instance I was specifically looking to pull in data on PINA:UBSFF, a french company, so all the financials are in EUR Mil, creating problems as USD is hard-coded later in the function (e.g. https://github.com/mwaldstein/tidyquant/blob/3812ae457674f3c635c92e7f3071dfe8b26bff91/R/tq_get.R#L591) There is also a bit of a failure that I haven't investigated in fetching the stock prices (here: https://github.com/mwaldstein/tidyquant/blob/3812ae457674f3c635c92e7f3071dfe8b26bff91/R/tq_get.R#L583) since the collection of stock prices doesn't match... A better solution, which I might take a stab at, is to split get="key.ratios" into two -
I may take a quick stab at the above refactoring - should help with testing / debugging as well... tldr - for european companies, there are deeper problems that my simplistic solution doesn't fix. |
Let me know what you find out. I'll certainly incorporate any code that makes the functions more accurate. I'm finding that it's difficult to account for all the possibilities in a global market. I was thinking of potentially scrapping the P/E ratio calculation, or like you said have a mechanism to enable the user to have options. The big issue for me is if there is potential for the calculation to be done incorrectly due to currency. If this cannot be checked, then I don't want to see users get incorrect results. |
can I get data of Indian Stock Exchanges Please. |
Key Ratios should now at a minimum pull non-US exchange key ratios. The Valuation Ratio calculation may not be compatible with Yahoo Finance prices, and therefore will not be returned.
|
Hi Matt,
Thank you so much for the great package.
I am trying to load some key financial ratios for China A shares.
Your base function for the key.ratios are hard coded with US exchanges. Do you have plan to make it generalized to non-US exchanges?
I can manually download the key ratios from financials.morningstar.com
here is an example http://financials.morningstar.com/income-statement/is.html?t=XSHE:200725®ion=CHN&ops=clear
Thank you
andy
The text was updated successfully, but these errors were encountered: