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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
35 0 1 5

Can I get historical data for a chain by specifying SDate, EDate?

Hello

I know I can use :

df= ek.get_data(['CFI2K1'], ['TR.CLOSEPRICE.date', 'TR.CLOSEPRICE.value'], {'SDate': '2021-03-01', 'EDate': '2021-04-21'})

to get data for a specific RIC, but what happens if I have a chain

0#CFI2:

which includes the above RIC(CFI2K1) along with CFI2M1,CFI2N1,....etc

Can I do the same thing with one request, without having to make a request for each included RIC separately?

Thank you

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonchain-ric
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.

Upvotes
Accepted
6.7k 8 6 7

@sfaka try this:

df,err = ek.get_data(['0#CFI2:'],'CF_NAME')
chain = df['Instrument'].astype(str).values.tolist()
df

df, err= ek.get_data(chain, ['TR.SETTLEMENTPRICE.date','TR.SETTLEMENTPRICE.value'], {'SDate': '2021-03-01', 'EDate': '2021-04-21','Frq':'D'})
df


1621007028666.png (80.9 KiB)
1621007389226.png (92.6 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.

Actually this will only for work for/near the current date, where the 'active' RICs are correct for these dates.

How should I change this to get historical data for all months from 1-jan-2019 until 1-jan-2020?

Thank you.

@sfaka So you need to create the expired RICs programatically using the following guidance:

So in your case: CFI2 is the ric root, say U is for Sept, 2020 should be 0, and decade is 2. Putting this together we have an expired RIC of CFI2U0^2 for the Sept 2020 contract - try viewing a chart in eikon with that RIC to confirm.

So you can programatically recreate all the expired RICs you need and then request data for them. I hope this can help.

1621593066301.png (130.5 KiB)
1621593195408.png (58.9 KiB)
sfaka avatar image sfaka jason.ramchandani01

Yes this is perfect.

Where can I read about these things to get more familiar with Eikon?

Also is there a way to get for CFI2c1 all prices for 2018-2020 with the respective contract month of each price? You can just point me to the page I should read about this.

Thank you again.

Show more comments
Upvote
35 0 1 5

Thank you Jason

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