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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
5 1 4 5

How to get list of leaver companies of the ASX 100 using the Python API?

I've been using the following code to get a list of current ASX 100 companies:

ek.get_data(['.ATOIA'], ['TR.IndexConstituentRIC','TR.IndexConstituentName'])

Using the desktop program, I can also get a complete list of all the leavers and joiners in the ASX 100 over time.

Does anyone know how I can use the Python API to get a similar dataset of all the leavers of this index?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonindexconstituents
icon clock
10 |1500

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

1 Answer

Upvotes
Accepted
4.6k 26 7 22

To get the leavers for the last calendar year, for example, you need to do this:

f = ['TR.IndexJLConstituentChangeDate','TR.IndexJLConstituentName',
     'TR.IndexJLConstituentRIC','TR.IndexJLConstituentComName']
df, e = tr.get_data(['.ATOI'], fields=f, parameters={'IC':'L', 'SDate':'0D', 'EDate':'-1CY'}
icon clock
10 |1500

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

Thanks so much!

Zhenya, I am looking to get a similar list for the ".UKX" index but get the following error:

{'code': 413,
   'col': 1,
   'message': 'Unable to resolve all requested identifiers.',
   'row': 0},

Could you point me to where I can get more information on the identifiers used on the call you suggest?

Thanks in advance.

".UKX" is not a valid RIC, hence the error message. One place where you can browse content available through Eikon is Content Kiosk app, which you can find by typing in "Content Kiosk" into Eikon command/search bar. Another is Eikon command/search bar where you can type in free text and select the best match from autosuggest. You may also want to browse the tutorials available under the main Eikon menu - Help - Tutorials & Training, which explain how to use Eikon to find the content you're interested in. Finally for specific questions about content you can contact Thomson Reuters Helpdesk.

Hello Zhenya, I tried this piece of code with '.SPX' index and 'EDate' : '-25CY'

It gives a list of 600+ companies, with the dates that I assume denote the time company left the Index (the last ConstituentChangeDate was 1995-01-18).

When I changed the end date with -30, even -50 years, the output was still the same. Do you maybe know why is that? Thanks!

Most likely because we don't track changes in constituents of this index that far back. You can verify this by contacting Thomson Reuters Helpdesk and asking how far back you can track changes in index constituents for S&P 500 in Eikon.

Click below to post an Idea Post Idea