Historical daily market caps for constituents of ETF

Using Refinitiv Data API with Python:


Exploring if it is possible, especially without looping any requests, to get the daily historical market cap for any given ETF? By that I do not mean the market cap for the ETF but the sum of market caps for the constituents. Is this data that is available?

Best Answer

  • aramyan.h
    Answer ✓

    Hi @jn02 ,


    You can do that in two steps. First, you would need to get ETF constituents as of a date:

    import refinitiv.data as rd
    rd.open_session()
    df = rd.get_data('XIU.TO', fields = ['TR.ETPConstituentRIC','TR.ETPConstituentName', 'TR.ETPConstituentRIC.calcdate', 'TR.ETPConstituentWeightPercent',], parameters = {'SDate': '2024-05-01'})
    df

    screenshot-2024-05-10-at-131422.png

    Unfortunetly, you can't get this historically in a straightforward way. I have a presented a more streamlined way of doing that for index constituents which you may want to adapt for ETFs. Check the article here- Building historical index constituents | Devportal (lseg.com).

    Next, once you have the constituents, you can request the historical market cap of those instruments:

    rics = df['Constituent RIC'].to_list()
    rd.get_history(universe = rics, fields = "TR.CompanyMarketCap", start = '2020-01-01', end = '2024-05-01')


    screenshot-2024-05-10-at-131653.png

    Hope this helps.


    Best regards,

    Haykaz

Answers

  • Thanks a lot!

  • Does this take into account if a ticker is no longer a constituent of an ETF? Or if it historically was but is not at date SDate. I am thinking from the perspective of rics not being dynamic. This seems to leave us with having to loop?

  • The date you provide under SDate will be used to retrieve constituents as of that date. If you need constituents for other dates, you may need to make separate calls.