Commodity Options data (Option Price)

Hi,

Using the API, is there a way to retrieve options data (mainly option prices) for commodities (e.g., 0#NG+, 0#CL+) from a past date? For example, I need the values of some Natural Gas and Crude options as of 12/29/2023. Is it possible to get option prices for those options on that specific day?

Currently, I use the following method (see image) to get the implied volatility in terms of moneyness. Can I adjust the approach below to achieve what I need? I have also used 'historical_pricing.summaries.Definition' and 'get_data' with the 'chain' function to retrieve the option chain. However, the issue with this approach is that it does not return expired RICs.


capture11.png

Best Answer

  • aramyan.h
    aramyan.h admin
    Answer ✓

    Hi @anurag.rathore ,


    The best way of getting prices is to use get_history or get_data functions as you mentioned above, which will return prices for expired contract. See some examples below:

    1. get_history with no fields specified will return all available pricing fields for a given instrument

    rd.get_history("NGG24^2", start = "2023-12-20", end = "2024-02-01")


    screenshot-2024-08-29-at-143632.png

    2. get_data with no fields specified will return all available pricing fields as of current date, however the paramaters param is not supported for historcial pricing fields. So to ask for a price in past you may need to use TR fields instead. See below:

    rd.get_data("NGG24^2", fields =[ "TR.ClosePrice", "TR.ClosePrice.date"], parameters={"SDate": "2023-12-29"})


    screenshot-2024-08-29-at-143929.png


    Hope this helps and let me know if I misunderstood your question.


    Best regards,

    Haykaz

Answers