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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 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-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonricscommodities
1609347158257.png (65.0 KiB)
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.

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

1609354216384.png (12.7 KiB)

1 Answer

Upvotes
Accepted
3 0 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 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea