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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 1 1 1

Python code to retrieve historical point in time daily futures curve (replicate Eikon for Excel below)

Python code to create this dataframe starting with row 10 (skip row 11)

eikoneikon-data-apipythonworkspaceworkspace-data-apirefinitiv-dataplatform-eikonricscommodities
1609347158257.png (65.0 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.

For some reason the output does not match the date range?

1609354216384.png (12.7 KiB)

1 Answer

Upvotes
Accepted
3 1 1 1

This one works...

contract = 'DCSc'

riclist = ["{}{}".format(contract, i) for i in range(1,13,1)]
print(riclist)

df = ek.get_timeseries(riclist,'close',
start_date='20140101',
end_date='20190401', interval='daily')

df.reset_index('Date', inplace=True)


df['Date'] = df['Date'].dt.strftime('%Y%m%d')
print(df)

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.