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']
)
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
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
@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.
Otherwise, you can contact the helpdesk support team directly via MyRefinitiv. The helpdesk team can find RICs for you.
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')
if you see from the df OHLC is not available but there are other available fields which might be useful