question

Upvotes
Accepted
1 1 0 1

Question regarding TimeSeries and Quotes

Pardon me, if someone has already answered this question, but I was unable to find it. Hopefully, someone out there can help me out.

We are currently doing an implementation on that utilises Timeseries and Quotes. We have come across a strange scenario involving expiry dates on certain quotes (COMQ9, COMX9, COMG9, and COMK0). E.g with COMQ9 Times returns expiry date 2019-08-01T00:00:00 while Quotes returns 31/07/2019 02.00.00. Aside from the format being different, the is a day of difference.


Is this some unique corner case? Or is this correct and if so why? Please advise.

Cheers

rkd-apirkdtime-seriesc#quote
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
141 1 4 1

@saz

In reviewing old threads, I'm not sure if this is still an issue? But anyway from your question I am not sure you are comparing like for like.

EXPIRY_DATE field in quotes is a string field that will contain (future) expiry date for the ric in question. Its a string -- but in a "date-like" format (dd mmm yyyy)... there will be no time or timezone information there. The HSTCLSDATE is similar format but will be date of most recent close price (in HST_CLOSE field).

In time series service there is no "expiry date" as such unless I misunderstand you - the time series response is array or Rows each of which has a timestamp corresponding to some previous date/time for the values in that row - returned as typed DateTime value i.e. not a simple string. As per most web services that datetime field will be in UTC when transported "over the wire" and for interday time series will always have 00:00:00 time component because it is a daily closing price -- so in reality its a date only (the wsdl may say "DateTime" but I suspect that is for consistency with other intraday operations)

Depending where you are, some timezone conversion in your local dev environment might move that date "forward" when view in local time i..e look like its 02:00 on day+1 if you were 2hrs ahead of UTC (for example) -- that would be a feature of your local dev environemtn / toolkit to access web services. So to guarantee time series dates dont have any time offset component suggest make sure its in UTC and then truncate to date only. IN .NET even though transport is in UTC typical web service client application will always see it in local time ... so would have to convert back to UTC (simple enough to do, but still needs to be done to see genuine "date only")

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
18k 21 12 20

Hi @saz

Can you share your python code which return different data on COMQ9 please ?

Thanks.

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
1 1 0 1

Hi @chavalit.jintamalit

In Python? The implementation is in C# can you work with that? Or?

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.

Hi @saz

I am sorry, I was confused on the API you are using.

I added C# tag in the question.

Upvotes
18k 21 12 20

Hi @saz

Can you provide snippet code and API you are using to retrieve information from Time Series interface and Quote interface ?

Thanks.

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
1 1 0 1

Hi @chavalit.jintamalit

Thanks for getting back to me again so quickly.

Here's for Quote first:

ReutersQuote.AuthorizationType authorization = RkdAuthorizator.CreateAuthorization<ReutersQuote.AuthorizationType>(
                   ReutersAuthentication.Username, "", ReutersAuthentication.Password, ReutersAuthentication.ApplicationId);


               InstrumentKey_2[] instruments;
               instruments = symbol.Select(x => new InstrumentKey_2 { Name = x }).ToArray();
               var request = new RetrieveItem_Request_3
               {
                   ItemRequest = new ItemRequest_2[]
               {
                   new ItemRequest_2
                   {
                       RequestKey = instruments,
                       Scope = Scope.List,
                       Fields = "DSPLY_NAME:CURRENCY:HIGH_1:LOW_1:CF_TIME:CF_DATE:TRDPRC_1:HST_CLOSE:PCTCHNG:NETCHNG_1:EXPIR_DATE:RDN_EXCHD2"
                   },


               },
                   TrimResponse = true,
               };
               var quotes1Client = new Quotes_1Client();
               ItemResponse_Short_Or_Full[] response;
               quotes1Client.RetrieveItem_3(null, authorization, request, out response);
               return response;

TimeSeries

ReutersTimeSeries.TimeSeries_1Client client = new TimeSeries_1Client();


                    ReutersTimeSeries.CacheRequest cacheRequest = null;
                    ReutersTimeSeries.GetTimeSeries_Response_4_Type response;


                    ReutersTimeSeries.Field[] field =
                    {
                        Field.OPEN, Field.HIGH, Field.LOW, Field.CLOSE, Field.CLOSEYIELD, Field.VOLUME, Field.BID,
                        Field.ASK
                    };
                    ReutersTimeSeries.MetaField[] metaField =
                    {
                        MetaField.NAME, MetaField.QOS, MetaField.CCY, MetaField.TZ, MetaField.TZOFFSET,
                        MetaField.NAME_LL
                    };


                    ReutersTimeSeries.InterdayIntervalType interval = InterdayIntervalType.DAILY;


                    bool trimResponse = false;


                    ReutersTimeSeries.GetInterdayTimeSeries_Request_4_Type request =
                        new GetInterdayTimeSeries_Request_4_Type()
                        {
                            StartTime = startDateTime,
                            EndTime = endDateTime,
                            Symbol = symbol,
                            Field = field,
                            MetaField = metaField,
                            Interval = interval,
                            TrimResponse = trimResponse
                        };


                    ReutersTimeSeries.AuthorizationType authorizationType =
                        RkdAuthorizator.CreateAuthorization<ReutersTimeSeries.AuthorizationType>(
                            ReutersAuthentication.Username, "", ReutersAuthentication.Password,
                            ReutersAuthentication.ApplicationId);
                    using (new TimeMeasure("Reuters TimeSeries client.GetInterdayTimeSeries_4"))
                    {
                        CacheResponse cacheResponse =
                            client.GetInterdayTimeSeries_4(cacheRequest, authorizationType, request, out response);
                    }
                    if (response != null)
                    {
                        data = new ReutersTimeSeriesData();
                        data.Symbol = symbol;
                        data.StartDate = startDateTime;
                        data.EndDate = endDateTime;


                        var responseItems = response.Items;
                        if (responseItems != null)
                        {
                            foreach (ReutersTimeSeries.Row_Full fullField in responseItems)
                            {
                                ReutersTimeSeriesDataPoint dataPoint = new ReutersTimeSeriesDataPoint();


                                dataPoint.Date = fullField.TIMESTAMP;


                                dataPoint.Open = fullField.OPEN;
                                dataPoint.Close = fullField.CLOSE;


                                dataPoint.Low = fullField.LOW;
                                dataPoint.High = fullField.HIGH;


                                data.DataPoints.Add(dataPoint);
                            }


                            data.DataPoints = data.DataPoints.OrderBy(d => d.Date).ToList();
                        }
                    }
					
					return data:


Since posting the question, we've made the observation that with all quotes, there is 1 day deviation. Quotes is always a day later than Timeseries. However, the timeseries format does contain some timezone data, which I think could be the culprit.

Please let me know if you need anything else.

Cheers

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.

Hi @saz

I am sorry, I do not recognize the code.

By any chance, are you using any wrapper classes ?

Or what API you are using ?

Where did you download the API ?

I believe that you are not using Eikon Data API.

So the question tag may be incorrect.

Upvotes
1 1 0 1

Hi @chavalit.jintamalit

To be honest, I wasn't sure if I posed the question in the right forum. A wsdl I'm using here is accessed here http://api.rkd.reuters.com/schemas/wsdl/Quotes_1_HttpAndRKDToken.wsdl

Is it possible that this is not the right forum? If so which forum should I pose the quesiton in?

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.

Hi @saz

You are using Knowledge Direct API (or TRKD API).

https://developers.refinitiv.com/en/api-catalog/refinitiv-knowledge-direct/refinitiv-knowledge-direct-api-rkd-api

Let me try to move your question to the appropriate forum.

Upvotes
1 1 0 1

Thank you :)

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
381 1 2 3

Thanks robin.

Hi saz, as mentioned by Robin the field EXPIR_DATE in Quote service display just the expiry date and not the time. In your query you have mentioned 'Times returns expiry date 2019retrieveitem-response-3.txt-08-01T00:00:00' which I dont see in TRKD Quote service. Is it possible for you to let us know where exactly you see this date/time for the RIC COMQ9 ?

I have attached json request and response from TRKD API Quote (RetrieveItem_3) containing expiry date info for this RIC COMQ9.

Do let us know if any questions.

Best,

Waseem retrieveitem-request-3.txt


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
155 1 3 2

Hello,

The Interday time series operation allows you to fetch the historical pricing data at a frequency of 'Daily', 'Weekly', 'Monthly', 'Quarterly' and 'Annual' frequencies. The fileds that time series service can provide in response is limited to the following:

OPEN, HIGH, LOW, CLOSE, CLOSEYIELD, VOLUME, BID and ASK. Expiry Date for futures contracts is not a field that time series can provide. However, time series does allow you to retrieve prices for a period range by specifying a Start Date and End Date parameters in the request.

The Quotes operation allows you to fetch all fields (most current value only) that are provided by the exchange. Hence, you are able to get the Expiry Date field via quotes since the exchanges does provide us a field for expiry date value for any future contract.

Further, all time zones in TRKD API are in UTC.

Please let us know if you still require any clarification.

Thanks and Regards,

OnlineSolutions@Refinitiv.com

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