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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 1 3

Pulling timeseries for a set of RICs do not give the expected output

Hi Team,

My client is trying to pull up the first available data point for a set of RICs. Using the ff gives him NaN list and the earliest data point pulled up is 05-27-2013:

df = ek.get_timeseries(bills, fields='CLOSE', start_date='1994-06-01', interval='Daily')

As you can see, it should give him the earliest data point available in the database which is 1994 and this is available in Eikon desktop and Eikon Excel.

Now, running the formula below, gives me the timeseries of JP6MT=RR and JP3MT=RR, where both of them automatically starts at 2013-05-27 (as per the screenshot above)

df_combined = ek.get_timeseries(['JP6MT=RR','JP3MT=RR'], fields='CLOSE', start_date='1994-06-01', interval='daily').

However, if he uses the formula below:

df = ek.get_timeseries('JP6MT=RR', fields='CLOSE', start_date='1994-06-01', interval='daily'), first available point is 04-11-2007. If he runs JP3MT=RR on its own, he will get it to start at 2007-04-11 as well. So logically speaking, if he is to run them as a combined function, he should get both of them to start at at 2007-04-11, and not 2013-05-27.

Also, why is he not able to pull up the actual first available data point which is 1994?

Thank you for your help!

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
nan.png (19.0 KiB)
jpm3mt.png (147.3 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.

Upvotes
Accepted
3.8k 4 4 6

Hi @Chrisma Joy.Salut

To avoid limitations and you can consider using ek.get_data() and provide wider time window.

df,err = ek.get_data('JP3MT=RR',['TR.BIDYIELD.date','TR.BIDYIELD'],{"Sdate":'1970-05-01', "Edate":'2019-07-17'})
df.dropna(inplace=True)
df.head(1)


ahs.jpg (39.3 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.

Upvote
7.6k 15 6 9

@Chrisma Joy.Salut

If I try

df = ek.get_timeseries(['JP6MT=RR','JP3MT=RR'],fields='CLOSE', start_date='1994-06-01', interval='daily') 
print('Return Row=',len(df.index)) 

it return

Return Row=1513

But and if I change it to request just one RIC

df = ek.get_timeseries(['JP6MT=RR'],fields='CLOSE', start_date='1994-06-01', interval='daily') 
print('Return Row=',len(df.index)) 

Return Row= 3000

I guess that it may relate with 3000 limit of points for inter-day data mentioned in the following post. And it looks like the problem still exists.

https://community.developers.refinitiv.com/questions/15616/eikon-scripting-api-issues-with-timeseries.html

https://community.developers.refinitiv.com/questions/6355/bug-in-get-timeseries.html

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.

Upvote
38.1k 69 35 53

@Chrisma Joy.Salut

Refer to this discussion thread, for the interday timeseries interval, it is limited to 3K rows for a single request.

From the raw output, the first returned data point for JP3MT=RR is '2013-05-27' while the first returned data point for JP6MT=RR is '2013-06-05'. For this reason, when the data was displayed on the dataframe, you see the NaN value for JP6MT=RR between '2013-05-27' and '2013-06-04'.

To avoid this issue, you need to specify end_date. The range could be 3-4 years for 2 RICs.

bills=['JP3MT=RR','JP6MT=RR'] 
df = ek.get_timeseries(bills, fields='CLOSE', start_date='1994-06-01', end_date='1998-12-31',interval='daily')
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.

@jirapongse.phuriphanvichai

thanks for your help. After running the below code, what do you get? I don't think you will get the time series from the specified start date to the end date either. Could you confirm?

bills=['JP3MT=RR','JP6MT=RR'] 
df = ek.get_timeseries(bills, fields='CLOSE', start_date='1994-06-01', end_date='1998-12-31',interval='daily')

@jefferson.low

This is the output:

output1.png (15.6 KiB)
output2.png (11.6 KiB)

Is it possible to write a loop to pull these RICs to get 3000 points for all of them?

Upvotes
3 0 1 3

Thank you @jirapongse.phuriphanvichai @moragodkrit Will relay this to the client.

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.

Upvote
18k 21 12 20

Hi @Chrisma Joy.Salut

You can refer to this document for the limitation and how to handle it.

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
38.1k 69 35 53

@jefferson.low

Yes, it is possible to write a loop to full all data points from 1994-06-01. However, it is unable to get the exact 3000 rows for each request. The code looks like:

import eikon as ek 
import pandas as pd
import datetime

bills=['JP3MT=RR','JP6MT=RR']
dfList = []
startDate = datetime.datetime(1994, 6, 1)
while startDate < datetime.datetime.now():
endDate = startDate + datetime.timedelta(days=1500)
df = ek.get_timeseries(bills, fields='CLOSE', start_date=startDate, end_date=endDate,interval='daily')
dfList.append(df)
startDate = endDate + datetime.timedelta(days=1)

result = pd.concat(dfList)
result
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.

This is wonderful, thank you!

Click below to post an Idea Post Idea