Fundamental data incomplete?
-
@buyers_are_back Hi,
Some fields in fundamental data are not available for all companies, and this is how we get the data from official sources. NaN values are set for companies where field is not available at all, but zero values can be found for companies which have had values at some point in history. For example, "NAS:ABNB" doesn't provide this information ('shares') at all, but 'NAS:REGN' have provided, last time at 2012.
By the way, the values you showed are not correct values for this field for all symbols. At least, this field, which refers to Common Shares Outstanding, is a field with integer values.
Thanks for pointing out the potential error in the data.Kind regards,
-
@support Thank you for the information. Is there a way to get the market cap of each stock in your framework?
Furthermore what is your data source? I see for example Shares Outstanding / Implied Shares Outstanding of "NAS:ABNB" is available on yahoo finance. https://finance.yahoo.com/quote/ABNB/key-statistics
-
@buyers_are_back Hi,
we use fundamental data from The U.S. Securities and Exchange Commission - EDGAR (sec.gov).
We are working on providing market capitalization field, and we will get back with update in coming week.Regards,
-
@support Thank you, looking forward to your update.
-
@support I have 3 more questions regarding adjusted close.
(1) I have not checked the source code but I assume your backtest / online evaluation is based on split- and divident-adjusted close prices?
(2) In
qnt.qndata.stocks
only close is provided. I checked it is split-adjusted properly but not dividend-adjusted (see attached screenshot). Should we retroactively compute the adjusted close based ondivs
? It would be nice to have it in the data so we don't have to compute it every time.(3) The
split_cumprod
column is always 1. What does it mean? It's probably not important. -
This post is deleted! -
@buyers_are_back Hi,
(1, 2) Yes, that's correct, we provide split adjusted prices in our datasets, but not dividend adjusted. The dividend adjustment is done in evaluation, under statistics calculation, when calculating relative_returns (you can check it inqnt.stats
module), you don't need to adjust close price on dividends. But yes, your comment makes sense, it could be useful for strategy development and we will at least provide a method for dividend adjustment in next qnt library update.
(3) split_cumprod is actually split adjustment factor, and if you divide open/high/low/close price with this factor you will get the real price of an asset on that point of time, the price before any split happened.
You are currently using older version of qnt library, just update it and you will see correct split_cumprod values. With the function restore_origin_data() fromqnt.data.stocks
you can get the "real" historical prices (not split adjusted).
Thank you for your comments. -
@buyers_are_back Hello. Yes, you can define your function as mentioned in the documentation.
https://quantiacs.com/documentation/en/data/fundamental.htmlPlease pay attention to the section "Potential Issues in Working with Fundamental Data".
The main problem with market capitalization is that it is necessary to adjust the price for splits, and these data are not always available on time. For example, the report with the number of shares is published after the split on the exchange.
The page contains links to where the data comes from (sec.gov).
import numpy as np import qnt.data as qndata import qnt.data.secgov_fundamental as fundamental def build_market_capitalization(fundamental_facts): shares = fundamental.build_shares(fundamental_facts) prices_no_split = qndata.restore_origin_data(market_data, make_copy=True) close_price = prices_no_split.sel(field='close') market_capitalization = shares * close_price return market_capitalization custom_builder = { 'market_capitalization': { 'facts': fundamental.FACT_GROUPS['shares'], 'build': build_market_capitalization, }, } market_data = qndata.stocks.load_ndx_data(min_date="2005-01-01") indicators_data = fundamental.load_indicators_for(market_data, indicator_names=['market_capitalization'], indicators_builders=custom_builder) display(indicators_data.sel(field="market_capitalization").to_pandas().tail(2)) display(indicators_data.sel(asset='NAS:AAPL').to_pandas().tail(2)) display(indicators_data.sel(asset=['NAS:AAPL']).sel(field="market_capitalization").to_pandas().tail(2))
-
Thanks for the reply. I know "market cap = #shares * price". The real issue is that #shares is not available for some stocks (e.g. META) so I have to rely on other data sources like yahoo finance.
Do you have an update? Thanks!
-
@buyers_are_back Hi,
the update was related to market_capitalization field availability and correctness, as vyacheslav_b described. Unfortunately, at the moment we cannot provide missing fundamental data, like number of ordinary shares, for some stocks (e.g. META). We are going to investigate potential new data sources in order to improve our datasets.
Regards,