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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
37 3 3 10

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-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonconstituents
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.

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

Upvote
Accepted
6.7k 8 6 7

@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 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea