Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
5 2 1 2

Streaming real-time sample

I have tried to use the code in the Streaming real time data tutorial, as follows:

But as you can see, it gives me an error message. Can someone help me solve the problem?

I have just upgraded to version 1.1.6.post2. The get_snapshot function works as expected...

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apirefinitiv-realtime
1600960115661.png (32.3 KiB)
icon clock
10 |1500

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

Upvote
Accepted
4.3k 2 4 5

Hi,

Your code is incorrect : a ')' left before streaming_prices.open()

Otherwise, I can run it on my side:

I assume that there is an hidden escape character that causes invalid syntax.

You can copy/paste from following block :

streaming_prices = ek.StreamingPrices(
     instruments = ['LCOc1', 'CLc1'],
     fields = ['CF_TIME', 'CF_BID', 'CF_ASK', 'OPEN_PRC', 'CF_HIGH', 'CF_LOW', 'CF_CLOSE'],
     on_refresh = lambda st, inst, fields : display_fields(st, inst, fields),
     on_update = lambda st, inst, fields : display_fields(st, inst, fields))
streaming_prices.open()



1600962775567.png (72.8 KiB)
icon clock
10 |1500

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

Upvotes
5 2 1 2

Thanks Pierre - you found the error... all working now. Incidentally, I copied the code from the tutorial, so the error is there...

icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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