download stock index price by a list of RICs

Hi! I am trying to download daily price of stock index from a list of RICs by the following code. But it does not work. Can you please help me on this?

df, e = ek.get_data(["MERV","SP500","ATX"], 
['TR.PriceClose(Curn=USD)','TR.PriceClose.calcdate'],
{'SDate': '2012-01-01',
'EDate': '2023-02-10','Frq':'D'})
df

Best Answer

  • Jirapongse
    Answer ✓

    @jiayin.meng.20

    Thank you for reaching out to us.

    Typically, the index RICs are prefixed with the "." character.

    The code looks like this:

    df, e = ek.get_data([".MERV",".SP500",".ATX"], 
                        ['TR.PriceClose(Curn=USD)','TR.PriceClose.calcdate'],
                         {'SDate': '2012-01-01',
                         'EDate': '2023-02-10','Frq':'D'})
    df

    1713431666155.png


Answers