Comments (12)
can I get data of Indian Stock Exchanges Please.
from tidyquant.
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
from tidyquant.
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.
Thank you Matt.
from tidyquant.
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:
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.
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.
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.
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.
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.
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.
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.
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.
from tidyquant.
Related Issues (20)
- Is tq_get() down from tidyquant? HOT 7
- tq_index("SP500") Not Working Ubuntu HOT 2
- tq_get does not work HOT 3
- Unexpected result from EOMONTH function
- quantmod dependency should now rely on 0.4.20 or later HOT 1
- tq_get("SP500") not retrieving sp500 stock prices HOT 1
- Missing prereq? HOT 1
- tq_performance test fails under PerformanceAnalytics 2.0.6 HOT 2
- Getting Tiingo Data example fails HOT 1
- Typo: periodReturns should not have an "s" at end HOT 1
- tq_exchange("NASDAQ") not working HOT 7
- List of all stock symbols for tq_get(x, get = "stock.prices") HOT 1
- stock.prices.japan not working HOT 1
- Tidyquant is not available at CRAN HOT 3
- tq_mutate problem
- FB stock symbol retired, need to use META as stock symbol in all documentation
- tq_get("TICKERS", get = c("dividends", "splits)) fails if there are no dividends or splits
- tidyquant::geom_candlestick HOT 6
- tq_get() returning rows with NA
- Request to add India stock market indexs (BSE and NSE) Along with mutual fund data HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tidyquant.