-
Survivorship bias free data
I would like to get the historical constituents for an ETF, S&P500 for example, using the lseg.data api in Python. Is there an easy way to do this and more importantly, will this data include stocks that are delisted so that my universe is free of survivorship bias? Moreover, in general is there a way to pull data for…
-
Pulling the first period where index constituents are available
I have this working code to identify when is the first period that the constituent lists has data. It correctly states that the oldest constituent list avaialble for S&P 500 (list code LS&PCOMP+MMYY) is 0989 or September 1989. How do I apply this code to multiple constituent codes for around 90 indices? from datetime…
-
RIC no longer works
I created a program that uses constituent data from the FTSE All World index, that no longer works. Is constituent data no longer available? indicies = rd_get_data( universe = ['0#.FTAWORLDSR'], fields = ['TR.IndexConstituentRIC'], parameters = { 'SDate':date_formatted } )
-
SPX history uses incorrect tickers
Hi, When trying to get historical data for SPX, get_history and get_data returns data using tickers of the current constituents and not of the constituents at the requested time. For instance, ld.get_history(universe=[f"0#.SPX"], fields=["TR.PriceClose"], parameters={"SDATE":"2011-02-01"}) returns the price closes of the…
-
GET CONSTITUENTS OF AN INDEX USING PYTHON CODE
How do I get the constituents of nifty 50 which is depicted by INNSE50 or .NSEI , I can see that on the datastream navigator but i want to extract via python code. I am trying to use this, df, err = ek.get_data( instruments = ['INNSE50'], fields = ['TR.IndexConstituentRIC', 'TR.IndexConstituentName'], parameters = {…
-
Joiners and Leavers for STOCK EXCHANGE (not MAIN INDEX)
Hi, I'm interested in retrieving historical joiners and leavers for stock exchanges. I've gone through a number of Q&As and am aware that there is functionality to obtain historical joiners and leavers for the main stock INDICES, but I wanted to know if the same exists for stock EXCHANGES. For example, the code below…
-
Historical Leavers and Joiners of .SPX
I need a list of Leavers and Joiners at the beginning let say at 01-01-1990 and then have the in and out for the following years in Phyton API. So this need to be done in 2 times : First having the list at special date let’s say 01/01/1990 Second the IN and Out the following years. For sample RIC : .GDAXI To have a…
-
Code Error
I tried import lseg.data as ld import pandas as pd import copy import plotly.express as px ld.open_session() ric = '.AXJO' start = '2014-01-01' end = '2025-08-26' df = ld.get_data(universe=[ric],fields =['TR.IndexJLConstituentRIC','TR.IndexJLConstituentChangeDate','TR.IndexJLConstituentituentChange'],…
-
Missing values for TR.IndexJLConstituentRIC.change when querying leavers and joiners of indices
See the following code (that works in general) and output. Until a few weeks ago, the code worked without the missing values. How can I get the (non missing) values for the variable TR.IndexJLConstituentRIC.change? ld.open_session() SP100_constitutents_Leavers_Joiners_df = ld.get_data( universe=[ '.OEXA' ], fields=[…
-
S&P 500 Index constituents every month
How can I get S&P500 index constituents every month since 2012-01-01? I am using excel sheet to download the data. I have tried using the function =@RDP .Data(".SPX","TR.IndexConstituentRIC","SDate=2012-01-01 CH=Fd RH=IN",B1) to get the ConstituentRIC, but it returned NULL. May I know why and how to solve this problem?…
-
Please check we are getting error using the below code.
Please check we are getting error using the below code. import refinitiv.data as rd rd.open_session() df = rd.get_data( universe = ['.JTOPI'], fields = ['TR.IndexJLConstituentRIC.change'] ) display(df)
-
Client is facing the issue in running the Report client has access for the RIC .FTAS
from datetime import datetime as dt import pandas as pd import eikon as ek app_key='c5468339768f4efd92d04b15e44ae3b62dab8f22' ek.set_app_key(app_key) index_code='.FTAS' initial_date = pd.Timestamp(2025,7,18) fields = ['TR.IndexJLConstituentChangeDate', 'TR.IndexJLConstituentRIC.change', 'TR.IndexJLConstituentRIC']…
-
How to get all constituents of the ETF Index IEAC.L via Python API Script ?
I am currently using the following code to extract the RICs of the ETF index IEAC.L: indices = ["IEAC.L"] # ========================= # SECTION 3: GET CONSTITUENTS # =========================def get_constituents(index_rics): all_constituents = [] for index in index_rics: print(f'Extracting constituents for {index}') result…
-
How do i do to get the historical list of constituents for NASDAQ, say from 1994-2024?
How do i do to get the historical list of constituents for NASDAQ, say from 1994-2024? I want to get it to excel.
-
Is it possible to retrieve the historical constituents of the ACWI index using Python?
Our main challenge has been downloading the constituents of the MSCI ACWI index, whether current or historical, as both are crucial for our objective. Unfortunately, we have been unsuccessful despite multiple attempts. Below are the details of our efforts: Code Attempt 1: import refinitiv.data as rd from…