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?
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.
@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.
Retrieving daily historic TR.Volatility20D with Eikon Data API
Eikon API access to historical volume and other financial data
1. get_timeseries cuts off historic data 2. get_data not working for all tickers
Calculate within EIKON API request
get_data returns multiple lines instead of one. leading to many 400 errors when requesting