alvarobartt / investpy

Financial Data Extraction from Investing.com with Python
https://investpy.readthedocs.io/
MIT License
1.59k stars 375 forks source link

investpy.get_stock_historical_data missing price history dates #494

Open mrkgoh opened 2 years ago

mrkgoh commented 2 years ago

I would like to report that there are significant amount of price historical data that is missing in some stocks.

To reproduce:

df = ip.get_stock_historical_data(                
                stock='KOIN',  # Other ticker with same problem: 'SCHB', 'CFMS', 'CYMA', 'SHCS'
                country='malaysia',
                to_date=datetime.now().date().strftime('%d/%m/%Y'),
                order='descending',
                from_date='01/01/1970'
                )
historical_entried_per_year = df.groupby(pd.Grouper(freq='Y')).count().sort_index(ascending=False).loc[:,'Open']
historical_entried_per_year

>>>Date
>>>2021-12-31    208    
>>>2020-12-31    240
>>>2019-12-31    154  # In Malaysia there are average 240 trading days per year
>>>2018-12-31    126  # In Malaysia there are average 240 trading days per year
>>>2017-12-31    184  # In Malaysia there are average 240 trading days per year
>>>2016-12-31    116  # In Malaysia there are average 240 trading days per year
>>>2015-12-31     96  # In Malaysia there are average 240 trading days per year
>>>2014-12-31    156  # In Malaysia there are average 240 trading days per year
>>>2013-12-31    118  # In Malaysia there are average 240 trading days per year
>>>Freq: -1A-DEC, Name: Open, dtype: int64
ymyke commented 2 years ago

I wrote the tessa package to help with issues such as these. See here: https://github.com/alvarobartt/investpy/issues/557