question

Upvotes
1 0 0 3

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

#contentderivativescommoditiesipa
capture11.png (28.4 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
7.1k 18 2 8

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


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi @aramyan.h

This is the futures data, I am looking for the option price data for these futures contracts.

Thanks

Hi @anurag.rathore ,


do you have the rics? you can replace the rics in my code with your rics. Or there is somthing else your trying to achieve?



your original question was around getting the prices and to get the historical prices you need to use the function I included in my answer by passing the RICs you are interested in. I am not a content expert and any content related question (e.g what are the RICs for certain options/futures) please raise a query with helpdesk via my.refinitiv.com. You may also want to checkout this thread which provides examples on chain expansion for option on futures - Proper queries for options on futures using Python and Eikon API - Forum | Refinitiv Developer Community


Best regards,

Haykaz

Thanks, Haykaz

Hi, please read my original post. It refers to an option chain, and the part in question is getting the RICs. Your code retrieves historical prices for futures contracts, not options. Options and futures are two different things.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.