For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
24 1 0 3

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'})

eikoneikon-data-apipythonworkspaceworkspace-data-apirefinitiv-dataplatform-eikoneikon-app-studio
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Upvote
Accepted
47.2k 110 44 60

@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
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks!!! It's just what I want