GithubHelp home page GithubHelp logo

Comments (12)

vikram-rawat avatar vikram-rawat commented on May 21, 2024 1

can I get data of Indian Stock Exchanges Please.

from tidyquant.

haohua avatar haohua commented on May 21, 2024

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

http://financials.morningstar.com/finan/ajax/exportKR2CSV.html?&callback=?&t=XSHE:200725&region=chn&culture=en-US&cur=&order=asc

http://financials.morningstar.com/finan/ajax/exportKR2CSV.html?&callback=?&t=XSHE:200725&region=usa&culture=en-US&cur=&order=asc

from tidyquant.

mdancho84 avatar mdancho84 commented on May 21, 2024

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.

from tidyquant.

haohua avatar haohua commented on May 21, 2024

Thank you Matt.

from tidyquant.

robby81 avatar robby81 commented on May 21, 2024

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&region=DEU

However:
tq_get("VOW", get = "key.ratios")
[1] NA
Warning message:
x = 'VOW', get = 'key.ratios': Error in UseMethod("as_list"): no applicable method for 'as_list' applied to an object of class "NULL"

AND:

tq_get("XETR:VOW", get = "key.ratios")
[1] NA
Warning message:
x = 'XETRVOW', get = 'key.ratios': Error in UseMethod("as_list"): no applicable method for 'as_list' applied to an object of class "NULL"

Do you have a solution how to get these key.ratios?

from tidyquant.

mdancho84 avatar mdancho84 commented on May 21, 2024

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.

from tidyquant.

mwaldstein avatar mwaldstein commented on May 21, 2024

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.

from tidyquant.

mdancho84 avatar mdancho84 commented on May 21, 2024

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.

from tidyquant.

mwaldstein avatar mwaldstein commented on May 21, 2024

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 -

  • A "simple" wrapper/cleanup of the Morninstar raw data without any computation - this would need a new name - raw.ratios?
  • The existing key.ratios with the first half replaced by a call to the above. This way, the simpler function is still available for companies that fail at the calculation.

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.

from tidyquant.

mdancho84 avatar mdancho84 commented on May 21, 2024

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.

from tidyquant.

mdancho84 avatar mdancho84 commented on May 21, 2024

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.

> tq_get(c("XETR:VOW", "AAPL"), get = "key.ratios")
# A tibble: 13 x 3
   symbol   section           data              
   <chr>    <chr>             <list>            
 1 XETR:VOW Financials        <tibble [150 x 5]>
 2 XETR:VOW Profitability     <tibble [170 x 5]>
 3 XETR:VOW Growth            <tibble [160 x 5]>
 4 XETR:VOW Cash Flow         <tibble [50 x 5]> 
 5 XETR:VOW Financial Health  <tibble [240 x 5]>
 6 XETR:VOW Efficiency Ratios <tibble [80 x 5]> 
 7 AAPL     Financials        <tibble [150 x 5]>
 8 AAPL     Profitability     <tibble [170 x 5]>
 9 AAPL     Growth            <tibble [160 x 5]>
10 AAPL     Cash Flow         <tibble [50 x 5]> 
11 AAPL     Financial Health  <tibble [240 x 5]>
12 AAPL     Efficiency Ratios <tibble [80 x 5]> 
13 AAPL     Valuation Ratios  <tibble [40 x 5]> 
Warning message:
VOW: simpleWarning in fun_transmute(eval(parse(text = x)), OHLC = FALSE, ...): missing values removed from data
 

from tidyquant.

carsancheznew1999 avatar carsancheznew1999 commented on May 21, 2024

I have been trying to get key ratios for brazilian stocks but the following error message appears. Do you have any idea? I have already checked the Morningstar's web page and the symbol seems correct.
image

from tidyquant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.