How to download forward chain for a given date?

Hi,

I am trying to access an entire forward chain for commodities on a given day.

For example, I would like to obtain all forwards/futures data for Henry Hub on 09/29/2023 or all forwards for 12/29/2023 for ERCOT North.

I have encountered the Commodity_Futures_RIC_Search.ipynb and have used a brute force method. However, it seems that the get_futures function does not always work for all commodities, such as NG, CL, and power.

Is there a more streamlined or simpler way to access entire forward data for a given day?

Thanks.

Best Answer

  • [Deleted User]
    [Deleted User] Newcomer
    Answer ✓

    Hi @anurag.rathore, does the below Python code using hte Refinitiv Data Library help?


    import refinitiv.data as rd
    rd.open_session()
    NGG24 = rd.discovery.Chain("0#NGG24+")
    _NGG24_df = rd.get_history(
    universe=[i.replace('/', '') for i in list(NGG24.constituents)[0:20]], # Only 1st 20
    fields=["ASK"],
    start="2024-01-01" # only that day
    )
    NGG24_df = _NGG24_df.T.dropna().T


    1705937745804.png

Answers