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
1 0 1 1

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

eikoneikon-data-apirefinitiv-dataplatform-eikonworkspaceworkspace-data-api
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.

Also I need the time series of the option chain

1 Answer

· Write an Answer
Upvote
Accepted
39.4k 77 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 512.0 KiB each and 1.0 MiB total.

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.