JerBouma / FinanceToolkit

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

Missing Symbols in FinanceDatabase available in FinancialToolkit #119

Closed kurucan closed 6 months ago

kurucan commented 6 months ago

I'm attempting to retrieve market cap such as "large, small cap" info for tickers in FinancialToolkit. I discovered that this information can be found in FinanceDatabase, so I've been trying to source market cap through the FinancialDB. I've encountered an issue where some symbols that are listed in FinancialToolkit do not appear in FinanceDatabase.

Is it also possible to retrieve market cap in FinancialToolkit?

To illustrate, here's the code I'm using for the HKSE exchange:

import financedatabase as fd from financetoolkit import Discovery API_KEY = '' discovery = Discovery(api_key=API_KEY) tickers = discovery.get_stock_list() equities = fd.Equities()

financialtoolkit = tickers[tickers['Exchange Code'] == 'HKSE'].reset_index() financedb = equities.select(country='Hong Kong', exclude_exchanges=False) financedb.reset_index(inplace=True) tickers_not_in_financialdb = financialtoolkit[~financialtoolkit['Symbol'].isin(financedb['symbol'])].reset_index(drop=True) tickers_not_in_financialdb

['0002.HK', '0003.HK', '0005.HK', '0006.HK', '0007.HK', .... ]

JerBouma commented 6 months ago

Hi!

You can get the Market Cap directly from the Finance Toolkit: https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios#get_market_cap

The current Market Capitalization is also available in the Profile function, see: https://www.jeroenbouma.com/projects/financetoolkit/docs#get_profile