Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon Data APIs /

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

avatar image
Question by jerome · Jul 16, 2019 at 02:38 PM · eikoneikon-data-apiworkspacepythonworkspace-data-apirefinitiv-dataplatform-eikontime-seriesc#

Making multiple Timeseries requests

Hi,

I need to know what the open price is of various assets. I can get that by making a simple timeseries request to test this.

public void Launch(String ric)
{
	Console.WriteLine("Get RIC: "+ ric);
	//Console.WriteLine("");
 
	request = timeSeries.SetupDataRequest(ric)
		//.WithView("BID")
		.WithAllFields()
		.WithInterval(CommonInterval.Daily)
		//.From(dt)
		.WithNumberOfPoints(1)
		.OnDataReceived(DataReceivedCallback)
		.CreateAndSend();
 
 
 
}

This request is made within a second after the exchange opens. The issue now is that sometimes there isn't a quote yet (especially for illiquid markets). In that case I have to query again and again until I get a good open.

To test this I changed .Daily to Intradat1Minute and made 2 requests with a Thread Sleep of 61 seconds. However, the return values I get are for the same timestamp.

This is what I do (sd.RIC+s is just the RIC)

TimeSeriesRequest(sd.RIC + s);
Thread.Sleep(61000);
TimeSeriesRequest(sd.RIC + s);
 
private static void TimeSeriesRequest(String ric)
{
	(new TimeSeriesRequestExample(timeSeries)).Launch(ric);
}

The output is:

ESc1: 2 (new!!!)

16-Jul-2019 18:17:00,3007.00,3007.25,3006.50,3006.50,549,1

16-Jul-2019 18:17:00,3007.00,3007.25,3006.50,3006.50,549,1

As you can see, even though I expect a different time stamp, they are indeed the same.

How can I solve this?

Thank you

Jerome

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

8 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Alex Putkov.1 · Jul 17, 2019 at 11:43 AM

This is pretty simple. You created two objects (two subscriptions) and assigned them to the same variable. This means your variable refers only to the last object you assigned to it. When you stop the subscription using this variable, only that subscription is stopped. All the other subscription objects you created and assigned to this variable are now orphans that continue to merrily chug along. You could keep all of your subscriptions in a list and stop them when you no longer need them. Or you could call DataServices.Reset(), which will uninitialize the connection to Eikon and terminate any subscriptions.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by zoya faberov · Jul 16, 2019 at 03:56 PM

Hello @jerome,

Warning, I may be off on this. My line of thought:

You appear to be interested in obtaining open price, in realtime, as soon as it becomes available, OPEN_PRC, or ASK and BID?

You would like to determine, if the market has opened, quoted or traded, yet?

Seems to me that Realtime Subscription may be more suitable for this purpose then Time Series?

OPEN_PRC should reflect the opening price. QUOTIM or QUOTIM_MS should reflect after the market open time, if the market has quoted, TRDTIM_MS should reflect after the market open time, if it has traded?

Will this work for your requirement?

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
Answer by jerome · Jul 16, 2019 at 04:19 PM

Hi Zoya,

Thanks for your reply. This would indeed work for Daily rates, but how would that work for hourly rates? I also need the open quote for an asset on an hourly basis? So what is the open quote for E-mini from 10:00-11:00 taken at 10:00:01, and for 11:00-12:00 taken on 11:00:01?

Thank you

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by Alex Putkov.1 · Jul 16, 2019 at 05:31 PM

@jerome
It's a bit hard to say what's going on with your example without seeing the full code including the event handling. My guess is that you get the same result because Sleep function suspends the thread including the processing of messages from Windows message pump, which prevents the COM layer underlying this .NET interface from raising COM events and delivering event notification to the application. Hence the response to your first request is actually never received by the application. But this is just a guess.
In any case for your purposes I suggest you try timeseries subscription rather than timeseries request. With timeseries subscription you'll get notification each time the data updates on the current (most recent) bar being built in real-time, you'll get notification when the new bar is started once the time interval corresponding to bar lapses (also signifying that the previous bar is now closed). It seems to me that listening to these events better answers your workflow than sending a request every minute.
If however you prefer sending the request for an update, then try scheduling the requests using a timer that doesn't suspend the thread and the processing of COM events.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
Answer by jerome · Jul 16, 2019 at 05:41 PM

Thank you - Time series Subscription might actually work better. Is there a C# sample code for that?

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by Alex Putkov.1 · Jul 16, 2019 at 06:00 PM

There's an example in the Timeseries Tutorial for Eikon .NET API.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
Answer by jerome · Jul 17, 2019 at 09:18 AM

Thanks vm. I worked on that yesterday. However, one question. If I start multiple subscriptions in the Launch() function:

public void Launch()
{
	Console.WriteLine("[3] Time series subscription example");
	Console.WriteLine("");
	
	subscription = timeSeries.SetupDataSubscription("EUR=")
		.WithView("BID")
		.WithAllFields()
		.WithInterval(CommonInterval.Intraday1Minute)
		.WithNumberOfPoints(1)
		.OnDataReceived(DataReceivedCallback)
		.OnDataUpdated(DataUpdatedCallback)
		.CreateAndStart();
 
	subscription = timeSeries.SetupDataSubscription("ESU9")
		.WithView("BID")
		.WithAllFields()
		.WithInterval(CommonInterval.Intraday1Minute)
		.WithNumberOfPoints(1)
		.OnDataReceived(DataReceivedCallback)
		.OnDataUpdated(DataUpdatedCallback)
		.CreateAndStart();
 
 
}

the system does not stop properly when I hit any key since one of the subscriptions continues(see below). How can I stop all subscriptions? Or should I create an array of

private ITimeSeriesDataSubscription subscription;

What is the best way to handle this?

Thank you

Up: Successfully registered to Time Series service.

[3] Time series subscription example

EUR=,17-Jul-2019 13:16:00,1.1216,1.1217,1.1215,1.1216,1,1

ESU9,17-Jul-2019 13:06:00,3006.25,3006.25,3005.75,3005.75,1,1

New point at ESU9 07/17/19 13:15:00 3006.5

New point at ESU9 07/17/19 13:16:00 3006.25

Updated point at EUR= 07/17/19 13:16:00 1.1216

Updated point at EUR= 07/17/19 13:16:00 1.1215

Updated point at EUR= 07/17/19 13:16:00 1.1216

Updated point at EUR= 07/17/19 13:16:00 1.1215

Updated point at EUR= 07/17/19 13:16:00 1.1215

For other usage examples please uncomment the required method call in timeSeries_ServiceInformationChanged().

Press any key to exit...

Updated point at EUR= 07/17/19 13:16:00 1.1216

For other usage examples please uncomment the required method call in timeSeries_ServiceInformationChanged().

Press any key to exit...

Updated point at EUR= 07/17/19 13:16:00 1.1216

For other usage examples please uncomment the required method call in timeSeries_ServiceInformationChanged().

Press any key to exit...

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
Answer by jerome · Jul 17, 2019 at 11:45 AM

Thank you!

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
8 People are following this question.

Related Questions

Retrieve current historic volatility surface

Server Error: {"code":500,"message":"read ECONNRESET","statusMessage":"Internal Server Error"}: After weeks of functioning we suddenly get this error at random point in our timeseries requests. No settings have been changed. How to fix this?

Client is using Eikon C# API, would like to get settlement price

Pulling GDP time series for country

I am using TimeSeries.SetupDataRequest and getting incomplete data

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges