JerBouma / FinanceToolkit

Transparent and Efficient Financial Analysis
https://www.jeroenbouma.com/projects/financetoolkit
MIT License
2.84k stars 347 forks source link

Getting a lot of NaNs #115

Closed abdel-ely-ds closed 7 months ago

abdel-ely-ds commented 7 months ago

Hi, I'm testing the library and run the following code: ` companies = Toolkit(symbols, api_key=API_KEY, start_date="2005-12-31") ratios = companies.ratios.collect_all_ratios() ratios_bis = ratios.reset_index(names=['ticker', 'ratio']) ratios_bis = ratios_bis[ratios_bis.ratio.isin(cols)]

I got a lof of NaNs even for maket cap and don't understand why. is this normal ? or is it a bug ? Thank you ! image `

The list of symbols: BOTJ BOWN BOWNR BOXL BPMC BPOP BPOPM BPRN BPTH BPTS BPYPM BPYPN BPYPO BPYPP BRAC BRACR BRAG BREA BREZ BREZR BREZW BRFH BRID BRKH BRKHW BRKL BRKR BRLS BRLSW BRLT BRNS BROG BROGW

The list of cols: Return on Assets Return on Equity Return on Invested Capital Return on Capital Employed Gross Margin Operating Margin Net Profit Margin Interest Coverage Ratio Market Cap Price-to-Book Price-to-Earnings Price-to-Earnings-Growth Price-to-Cash-Flow Price-to-Free-Cash-Flow Interest Coverage Ratio

JerBouma commented 7 months ago

This is simply because those companies didn't go public as far as you are looking back. E.g. BRAC went public in 2022 so there is no data for this ticker before that date.

2023 is NaN for companies that haven't yet released their annual report for 2023.

abdel-ely-ds commented 7 months ago

This is simply because those companies didn't go public as far as you are looking back. E.g. BRAC went public in 2022 so there is no data for this ticker before that date.

2023 is NaN for companies that haven't yet released their annual report for 2023.

The majority of the companies went public before take the example Screenshot_2024-02-21-19-15-19-500_com android chrome

2023 is NaN for companies that haven't yet released their annual report for 2023 -> I'm talking about market cap

JerBouma commented 7 months ago

There is a rich history for each of these tickers, e.g. BOTJ what you are showing:

image

Please note that if you are using a Free plan you are limited to 5 years as described here: https://site.financialmodelingprep.com/developer/docs/pricing

Please see the definition of Market Cap here which requires financial statements to perform the calculation.

abdel-ely-ds commented 7 months ago

Sorry I showed the wrong ticker. I wanted to talked about BPYPN. It IPOed in 2020 but in my first screenshot, we have only market cap for 2020 and NANs for 2021 and 2022 and I don't understand why ?

Yes indeed i'm using the free version. I want to test it before commiting ! Thanks for your support

image

JerBouma commented 7 months ago

There seems to be no data for this company after 2020: https://site.financialmodelingprep.com/financial-statements/BPYPN

Please report this issue to FinancialModelingPrep so they can have a look: https://site.financialmodelingprep.com/contact

JerBouma commented 7 months ago

Let me know if there is anything else.

abdel-ely-ds commented 7 months ago

Let me know if there is anything else.

I've just contacted the data provider about the above issue. I'll continue testing the library and let you know thanks !