Survivorship-bias free constituents using chain RICS?

Hello,
I would like to create portfolio using the constitutents of the S&P500 (as benchmark index). However, the older the period of data extraction, there is a smaller number of constituents on the data frame. I am assuming that the chain RICS contains only up-to-date constituents, and not the historical ones. Is is there an option to get the historical list of constituents with their respective additions and delistings of the index?
df, err = ek.get_data(
instruments = ['0#.SPX'],
fields = [
'TR.ISINCode',
'TR.PriceClose.date',
'TR.PriceClose',
]
, parameters={'SDate': '-20Y', 'EDate': '0D','Frq':'Y'}
)
Best Answer
-
There is an issue regarding historical data for index constituents and weightings, as mentioned in this thread.
I checked and found that you are correct. It returns the current constituents.
Please contact the Eikon support team directly via MyRefinitiv, and ask for the update of <ALERT96> and how to get the historical list of constituents with their respective additions and delistings of the index in the Eikon Excel with the =TR function.
If the =TR function can be used to get the information, we can use the same parameters with the get_data method.
0
Answers
-
@Jirapongse I just checked <alert96> and the issue is still going on, with no estimated resolution date.
So, looking from inspiration in similar threads on this forum, I think I have overcome this issue by doing the following to get the historical constituents each month.
from datetime import datetime
from dateutil import rrule
import time
# dates
start_date = datetime(2000, 1, 1)
end_date = datetime(2022, 1, 1)
df_concat=pd.DataFrame()
for dt in rrule.rrule(rrule.MONTHLY, dtstart=start_date, until=end_date):
dt1=dt.strftime("%Y%m%d")
df1, err = ek.get_data('0#.SPX({})'.format(dt1), ['TR.RIC','TR.CompanyName'])
df1['index_date']=dt1
df_concat = pd.concat([df_concat, df1])
time.sleep(1)
df_concatWhile this works for small periods of time (less than a year), I get the following error if I request for 20 years.
EikonError: Error code 400 | Backend error. 400 Bad Request
I don't get why this happens since I am timing the request, and the request is relative small.
0 -
I can run it properly. The output is:
The problem could be the server timeout, as mentioned in this thread.
0 -
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 620 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 254 ETA
- 557 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 276 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 662 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 229 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛