How to pull index data from Datastream in Python?

Options

For example, I want to pull the price of Hang Seng Index which the ric is ".HSI".

I can use the ric to pull price from Eikon, but I can't pull from datastream.
Tagged:

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @Ren

    To use a RIC in the Datastream, you need to embrace it with angle brackets <>.

    ds.get_data(tickers='<.HSI>', fields=['PI','PE'], kind=0)

    The output is:

    1644812259598.png

    To list all available fields, please refer to the Datastream Navigator website.

Answers