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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 0

How Get options chain for Crude Oil futures via python eikon API?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikon
icon clock
10 |1500

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

Also I need the time series of the option chain

1 Answer

Upvote
Accepted
39.2k 75 11 27

To retrieve the chain for NYMEX crude oil futures use for instance

import refinitiv.dataplatform as r
import refinitiv.dataplatform.eikon as ek
rdp.open_desktop_session('YOUR_APP_KEY')
df, err = ek.get_data('0#CL:',['CF_LAST'])
df

Use chain RIC '0#CLc' instead of '0#CL:', if you would like continuous future RICs
Then to retrieve close and settle price history for say the nearest contract use

fut_ric = df.loc[0,'Instrument']
rdp.get_historical_price_summaries(fut_ric, fields=['TRDPRC_1','SETTLE'])
icon clock
10 |1500

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

Click below to post an Idea Post Idea