.NET timeseries : different results for same request
Hello,
I am using the TimeSeries object from the .NET library.
Everything is working but I observed something that I would like to understand. When I do the same request recursively, (same RIC, same View and same date interval) the API return different results.
Here is an example :
_request = TimeSerieItem.SetupDataRequest("BBEURENE1Y=")
.WithView("PAR_YLD")
.WithAllFields()
.From(new DateTime(2016,1,1))
.To(new DateTime(2017,1,1))
.WithInterval(CommonInterval.Daily)
.OnDataReceived(DataReceivedCallback)
.CreateAndSend();
This request will return the correct results the first time. If I call it again (during the same run time) with the same param the resulted enumeration will be empty.
I tried to create a new instance of TimeSerieItem for each request like this:
TimeSerieItem = Service.TimeSeries;
TimeSerieItem.ServiceInformationChanged += timeSeries_ServiceInformationChanged;
but it does not change anything.
Could someone explain me the reason of such results ?
Thank you !
Best Answer
-
Timeseries data is frequently retrieved in portions aka chunks. New OnDataReceived event is raised each time a new chunk of timeseries data is retrieved. You may have multiple OnDataReceived events raised for a single request and chunk.IsLast property is provided to tell when the data retrieval for a given request is complete. A chunk returned into OnDataReceived event handler may contain no records. This most commonly happens for the last chunk retrieved for the request. In other words it's common when for a given request several OnDataReceived events are raised with chunks of timeseries delivered in each instance of the event and no timeseries delivered in the last instance of the event (the last event merely signifying that the data retrieval for the request is complete through chunk.IsLast == true).
The above behavior is normal and expected for any request. See the section titled "Request" in this tutorial. Make sure you check IsLast property in your OnDataReceived event handler. If chunk.IsLast == false you should expect further OnDataReceived events for the same request.
I'm afraid I'm not following the significance of adding recursive call to the Request procedure from within OnDataReceived event handler. Apart from creating an obvious endless loop, you actually may have exponentially multiplying endless loops since each request may result in multiple OnDataReceived events.0
Answers
-
I'm not sure I understand what you mean by "empty enumeration". Are you saying the chunk object returned to DataReceivedCallback contains zero records? This can happen when multiple OnDataReceived events are raised for the same request, which is quite common. Are you collecting records from each chunk returned every time OnDataReceived event is raised and checking IsLast property to determine when all data has been retrieved for the RIC?
0 -
Let's suppose that situation :
public void Request(){
_request = TimeSerieItem.SetupDataRequest("BBEURENE1Y=")
.WithView("PAR_YLD")
.WithAllFields()
.From(new DateTime(2016,1,1))
.To(new DateTime(2017,1,1))
.WithInterval(CommonInterval.Daily)
.OnDataReceived(DataReceivedCallback)
.CreateAndSend();
}private void DataReceivedCallback(DataChunk chunk){
// Here I check the data received
// First time request return around 60 records
// Zero records are returned the second time
Request();
}
As you can see parameters are not changed and the callback function is always the same.Of course this is not a real situation, in my case the constituent's RIC will be updated to retrieve information for all the maturity.
I just wonder why this happens ?0 -
Aaah ok I did not understand that the SetupDataRequest method could trigger the callback function more that once... thought I was only the case with the SetupDataSubscription method.
Now if I check the IsLast property of the chunk before requesting again everything is working as expected ! Logic !
Thanks a lot for your help @Alex Putkov.1! It gives me a better understanding !
0
Categories
- All Categories
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 683 Datastream
- 1.4K DSS
- 613 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 248 ETA
- 552 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 627 Refinitiv Data Platform Libraries
- 5 LSEG Due Diligence
- 1 LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 84 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛