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
3 1 1 4

Retrieve Historical Economic Data With Release Date Python API

Hi,

I'm trying to replicate the following table using Eikon Python API:

1645195824808.png

When I download it, in addition to reference point time series (first column above), I also get a worksheet with First Release Data (second column):

1645195896569.png

It is very important when performing backtests to avoid look-ahead bias, which is almost always the case when dealing with monthly economic data.

How am I able to replicate the table in the first image for not only this specific Brazil CPI series, but any economic data (=ECI) using Python API?

Thanks in advance,

eikon-data-apihistoricaleconomic-data
1645195824808.png (142.9 KiB)
1645195896569.png (27.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.

<AHS>

Note: I can only find the latest data, seems like the time series data is not available. Please advice in case you have any idea.

df, err = ek.get_data('BRCPIY=ECI',['ECI_ACT_DT', 'CTBTR_1', 'FCAST_PRD'])
df

1645447152727.png

1645447140943.png

1645447140943.png (49.3 KiB)
1645447152727.png (18.6 KiB)
Upvotes
Accepted
5.8k 21 2 6

Hi @tiago.marchiore,


Would you happen to have Datastream DSWS? If so, does the below provide you with the nessesary data?


df1 = ds.get_data(tickers="<BRCPIY=ECI>", # Datastream Mnemonic "BRCPW.%YR",
                 fields=["DS.NDOR1", "DS.NDOR2", "DS.NDOR3", "DS.NDOR4", "DS.NDOR5", "DS.NDOR6", "DS.NDOR7", "DS.NDOR8", "DS.NDOR9", "DS.NDOR10", "DS.NDOR11", "DS.NDOR12"],
                 kind=0)  # ' kind=0 ' is needed here as we are looking for static data that doesn't change with time.


1645468821865.png



1645468821865.png (29.5 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.

DATASTREAM indeed solved my problem. You can access PIT (point in time) series for economic data, using the fields "REL1" for first release value and "DREL1" for first release date. Thanks!
Upvote
14.2k 30 5 10

hi @tiago.marchiore ,

The code below can be used to retrieve the first release data.

However, refer to the answer in this thread, the original release date cannot be retrieved using Eikon Data API but it could be retrieved using Datastream DSWS as mentioned by Jonathan in the comment above.

import eikon as ek
ek.set_app_key('#### YOUR VALID APP KEY ####')

df=ek.get_timeseries(['BRCPIY=ECI'],start_date='2019-03-01',end_date='2022-02-20',interval='monthly')
df

1645545954572.png

I hope this could help


1645545954572.png (48.5 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.

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.