Historical CDAX

Hi,

I would like to download all companies that were part of the CDAX between 2000 and now. I am using an API (Python) but I have no clue what data to pull. I would appreciate all help. Thank you

Best Answer

  • aramyan.h
    Answer ✓

    Hi @jiri.tresl ,


    The code below will provide index constituent changes for your requested period:

    df = rd.get_data('.CDAX', ['TR.IndexJLConstituentRIC' , 'TR.IndexJLConstituentName', 'TR.IndexJLConstituentChangeDate', 'TR.IndexJLConstituentChangeDate.change'], parameters = {'SDate': '2000-01-01', 'EDate':'2023-10-30'})
    df
    screenshot-2023-10-30-at-093930.png

    And the code below will show you the current constituents where you can also add parameters = {'EDate': '2023-10-30'} to request for a specific date:

    df = rd.get_data('.CDAX', ['TR.IndexConstituentRIC' , 'TR.IndexConstituentName'])
    df


    screenshot-2023-10-30-at-094303.png


    Hope this helps.


    Best regards,

    Haykaz

Answers

  • Hi @jiri.tresl ,

    The code below can be used with the Eikon Data API to retrieve the data of the current index constituent

    df, err = ek.get_data(['.CDAX'], ['TR.IndexConstituentRIC'])
    df

    1698659206904.png

    and this code can be used to get the constituent change of this index (joiner and leaver) since

    df, err = ek.get_data('.CDAX', 
    ['TR.IndexJLConstituentChangeDate',
    'TR.IndexJLConstituentRIC.change',
    'TR.IndexJLConstituentRIC'],
    {'SDate':'2000-01-01', 'EDate':'2023-10-30', 'IC':'B'})
    df

    1698659395784.png

    By combining these two dataframe, you will get all of the constituents of this index. Hope this helps and please let me know in case you have any further questions.