How to get Refinitiv Contributor Curves using rd.get_data or rd.get_history?

Hi,

Can we use the RD library to get the data, I need to generate a forward curve for these products (Look screenshot) as of 12/29/2023, which means I require data spanning 5-10 years. It should start from January 2024 to whatever the end date is for the curve.


For example, how do I access this data for 12/29/2023? This would include RICs that are expired right now—January, February, and March—and unexpired RICs. How would I programmatically access this curve for 12/29/2023 using the RD library, possibly with rd.get_data or rd.get_history?


1714490667298.png

1714490656348.png


Best Answer

  • Jirapongse
    Answer ✓

    @anurag.rathore

    Thank you for recahing out to us.

    To use the get_data or get_history methods, you need to know instrument codes which could be RICs.

    You can use the search API in the Refinitiv Data Library for Python to search for RICs. For example, the following code searches RICs in the 0#ULSDCAL: chain RIC.

    df = rd.discovery.search(
        view = rd.discovery.Views.SEARCH_ALL,
        filter = "PrimaryChainRIC eq '0#ULSDCAL:'",
        select = "DocumentTitle,RIC,PrimaryChainRIC,ExpiryDate",
        top = 1000)
    df

    1714711038033.png

    Then, you can use RICs with the get_history method.

    rd.get_history(["ULSDCALQZ3^2"])

    1714711097846.png

    You can refer to the examples on GitHub.