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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
21 0 0 2

get_timeseries with extra parameters

Hello, presuming get_timeseries mimics the functionality of RHistory Excel function I would like to use the TSREPEAT parameter. I would like to download time series data that is not available in the TR function so I'm guessing not available via get_data in the API.I am trying to download similar data for seven rics and don't want to have to line up all the dates afterwards.

In Excel using RHistory with TSREPEAT=Y works just fine, but I notice that this field is not available as a function param in the API. I have tried using SendJSONRequest with same request string but injecting "tsrepeat":"Y" but it seems to be ignored.

Interesting that this TR help page: https://customers.reuters.com/rph/tremo/sliver.aspx?topic=RHistory states that the default is TSREPEAT = Y but get_timeseries default behaviour appears to be N.

There are other params like DAY and NULL which would be good to also have added if possible.

Thanks in advance.

Richard

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

I also tried using the get_timeseries parameter Calendar thinking that it might force the dates to line up on each timeseries per ric, but each of the three settings seemed to have no effect.

Upvotes
Accepted
4.6k 26 7 22

@richard.fell

Apologies for the delay, there is no way to organise this out of the box. I guess you can load the API response into some data frame structure like deedle. There is also a bulk timeseries request i developed for a hackathon that you can use as a starting point.

bulkdatarequestcs.zip

Here is the init routine:

new BulkDataRequestSetup()
             .WithRics("AAA1YCD=R", "AA1YCD=R", "A1YCD=R", "BBB1YCD=R", "BBCD1Y=R", "B1YCD=R", "CCC1YCD=R")
             .WithFields("CLOSE", "TIMESTAMP")
             .WithInterval(new Interval(IntervalType.Daily, 1))
             .WithNumberOfPoints(100)
             .OnDataReceived(DataReceivedCallback)
             .OnStatusUpdated(StatusUpdatedCallback)
             .CreateAndSend();

And the callbacks signature:

private static void DataReceivedCallback(Dictionary<string, List<double>> dictionary)
private static void StatusUpdatedCallback(Dictionary<string, IRequestStatus> requestStatuses)


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
4.6k 26 7 22

@richard.fell, get_timeseries does not really mimic RHistory, they just use the same backend, TSREPEAT functionality is done on the desktop, if I am not mistaken.

The get_timeseries call gives you back a pandas data frame, it is very easy to achieve what you require without any additional tools. Could you provide the rics that you are looking at please, so I can provide you with a relevant code sample?

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.

Hello Zhenya

Thanks you for your reply. I use c# and prefer to work with the JSON data so don't use Pandas. The rics I am using are AAA1YCD=R, AA1YCD=R, A1YCD=R, BBB1YCD=R, BBCD1Y=R, B1YCD=R AND CCC1YCD=R.

Is there a way to force the dates to line up and return only one TimeSeriesData list?

Thanks

Richard

Upvotes
3 0 0 3

Hi @Zhenya Kovalyov I tried running the sample you uploaded in C#. Would you mind sending a sample on how to call the implementation of these codes? Thank you.

Ian

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.

@Ian Dexter.Sinel not sure I understand what you mean, if it is the init routine you are after, it is in the original response.

Upvotes
1 0 0 0

Hi -

my apologies for bringing this up again, but I do not seem to get what the "calendar" parameter in get_timeseries does at all. Similar to Richard in the original question, I get the same results for the RICs I tested, no matter if I set "calendar" to "tradingdays" or "calendardays".

Is there really no way to use get_timeseries to get all calendar days as an index and NaN for the days without data?

Thanks,

Andy

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 python eikon API users, a way to add missing dates with NaN:

ts = ek.get_timeseries(...)
idx = pd.date_range(min(ts.index), max(ts.index))
ts.index = pd.DatetimeIndex(ts.index)
ts = ts.reindex(idx)

The value of calendar argument has an effect on intraday timeseries. It controls whether the timeseries include pre and post market trades or only the regular trading session.

Thanks, Alex.

May I suggest that you clarify the documentation accordingly?

BTW: Resampling the result from get_timeseries with resample('D').asfreq() appears to be the fastest way to get the functionality that I was looking for initially.

Click below to post an Idea Post Idea