Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
21 0 1 5

historical option strike chain

I'm using below code for getting historical option chain data for AAPL....Please provide the symbol for US Stock BRK.B to get the below data :


df, err = ek.get_data(

instruments = ['0#AAPL*.U'],

fields = ['PUTCALLIND','STRIKE_PRC','EXPIR_DATE']

)

eikon-data-api#content
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 @peeush ,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thank you,

AHS

@peeush

Hi,

Please be informed that a reply has been verified as correct in answering the question, and marked as such.

Thanks,

AHS

Upvote
Accepted
5k 16 2 7

Hi @peeush


For the active ones you can either use chain from Refinitiv Data Libraries as advised here in your previous question or use Eikon as suggested above:

df, err = ek.get_data(
    instruments = ['0#CL+'],
    fields = ['PUTCALLIND','STRIKE_PRC','EXPIR_DATE']
    )
df

This will return the monthly contract chains. Then for each chain:

df, err = ek.get_data(
    instruments = ['0#/CLJ24+'],
    fields = ['PUTCALLIND','STRIKE_PRC','EXPIR_DATE']
    )
df


screenshot-2024-03-07-at-093727.png

As for the expired ones, those are not accessible directly and you need to reconstruct them following the RIC construction Rules. You can reach out to Helpdesk for more details by posting a question.

I have build similar workflows for equity options and futures here and here which might be useful when attempting to build one for options on futures yourself. You may need help from Helpdesk to learn the construction Rules.


Hope this helps.


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 want to understand one thing...e.g. if one of the options is expiring today ...and i try to fetch its data using option chain as you mentioned above ...actually i am trying to fetch the historical prices ....will the contract will still be available in this list for sometime or it will immediately gets removed since contract expired ..also when i'm putting bid and ask in the fields it is giving me single entries ...do i have to use get_timeseries to get minute data and the RIC's only i can get from here ?

From the list above , i tried to fetch data for CL25D24 contract ..but not getting any data ..is it data availability issue ..or some issue in the syntax below :


#df = ek.get_timeseries(["CL25D24"],start_date="2023-01-01", end_date="2025-02-20", interval="minute")


df, e = ek.get_data('CL25D24', ['ASK', 'BID'])

Hi @peeush ,


Whether it gets removed, I would advice talking to the Helpdesk. As it comes to the historical prices, I would advice using get_timeseries or get_history from RD Libraries. Finally, your code with ek.get_timeseries is correct and seems there is no data for your request. I have tried the same call with RD Libs (which returns all available fields if fields parameter is skipped) and this is what I got:

rd.get_history('CL25D24', start="2023-01-01", end="2025-02-20", interval = '1min')

screenshot-2024-03-07-at-115756.png

if you see from the df OHLC is not available but there are other available fields which might be useful

Best regards,

Haykaz

hi need to know does this include weekly contracts also ..if not how can we get the weekly contract chains

Weekly RICs may have different specification. Please see below:

screenshot-2024-03-08-at-111719.png

And I would advice contacting the helpdesk for other content related questions, if any.

Best regards,

Haykaz

Upvotes
79.2k 251 52 74

@peeush

Thank you for reaching out to us.

Is it this one?

df, err = ek.get_data(
    instruments = ['0#BRKB*.U'],
    fields = ['PUTCALLIND','STRIKE_PRC','EXPIR_DATE']
    )
df

You can use the RIC Seach tool to search for RICs.

1709793342819.png

Otherwise, you can contact the helpdesk support team directly via MyRefinitiv. The helpdesk team can find RICs for you.


1709793342819.png (35.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.

how can i search for CL futures options in the same tool ..like i'm trying to find Nymex CL future options both active and expired RIC's

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.