Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
37 9 10 13

No constituent for SPX in 2015

I would like to retrieve constituents of the SP500 in 2015 but i get an empty list:


const_SP500_2015        = ek.get_data('.SPX','TR.IndexConstituentRIC',parameters={'SDate': '2015-01-09', 'EDate': '2015-01-09'}) 


Could you explain me why? is there something wrong in the formula?

eikoneikon-data-apipythonworkspacerefinitiv-dataplatform-eikonworkspace-data-apiconstituents
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.

Your formula is correct. But TR.IndexConstituentRIC is support up to 2015-04-15 afterward. You can use the TR formula to get the constituent RIC =TR(".SPX","TR.IndexConstituentRIC","Sdate=2015-04-15")

Hence, using "0#.SPX(2015-01-09)" as ric is alternative which provide by jason.ramchandani

Hope it can help.

1 Answer

· Write an Answer
Upvote
Accepted
10.6k 20 6 9

@Tulkkas thanks for your question. There are a couple of ways you can do this. Please see this post. In short - the easiest way is:

ek.get_data("0#.SPX(2015-09-01)", ["TR.CompanyName"])

In your example you are using the index (.SPX) as the underlying - we have a concept of chain RICs - so .SPX is composed of 500 individual RICs in a chain. Instead of referring to each of the 500 individual RICs you can just refer to the chain (which is 0#.SPX for S&P500, or 0#.FTSE for FTSE100 etc (basically just add a 0# in front of whatever index you want).

I hope this can help.

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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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