Extract historical trade date with Eikon API

I am trying to use the following code to get the historical market cap with related trade date. But there is only one response for trade date, not the corresponding series. How to solve it?

df, err=ek.get_data('0700.HK',['TR.CompanyMarketCap','Trade_Date'],{'SDate':'2020-01-01','EDate':'2020-02-10','Frq':'D'})

Best Answer

  • @Jayden.Zhang

    Refer to Eikon Excel Formula Builder, TR.CompanyMarketCap is in the Time Series Ratios category which can provide time-series data. However, TRADE_DATE is in the Real-Time category which doesn't provide time-series data.

    To get the date field of TR.CompanyMarketCap, you can use the TR.CompanyMarketCap.Date field instead.

    df, err=ek.get_data('0700.HK',
                        ['TR.CompanyMarketCap','TR.CompanyMarketCap.Date'],
                        {'SDate':'2020-01-01','EDate':'2020-02-10','Frq':'D'})
    df

Answers