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

StreamingPrices run forever

Hi,

I'm using the Eikon Data API and trying to get streaming prices working from a script (not jupyter). I'm using the example code provided on PyPI and on github (in a script form). Currently the streaming_prices.open() receives updates and refreshes for the specified instruments and then almost immediately completes and ends the script. Is there a way to run a StreamingPrices instance "forever" and use the callbacks to evaluate realtime data?

Cheers
eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apistreaming-prices
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
25.3k 89 12 25

Hi @airxhi

You can try something like

streaming = ek.StreamingPrices(....) 
streaming.open() 
asyncio.get_event_loop().run_until_complete(asyncio.sleep(60)) 
streaming.close()


where the above will open the stream, run for 60 seconds before closing the stream.

If you want to run forever you can put the asyncio call in a continuous loop?

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.

Hi ,


Have one query . If we go like above ...and put asyncio call in continuous while loop ....will after 60 seconds the code will again request for new streaming.open() request and it will be counted as 1 more request or it will just keep the current stream open and will not count it as a seperate request. This i'm asking in context of the number of streaming.open requests we can send in a day ..Also in one request how many instruments i can send for streaming prices . I need to get the AT THE MONEY strike prices of a particular option during a session ...instead of subscribing to all strikes is there a way i can subscribe to ATM strike RIC's in between the session ...I have used above streamingPrices open request only at start of the session .


Thanks

Sumit

Upvotes
1 1 1 1

Hi Umer,

That's exactly what I was looking for, thanks!

Kind Regards

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

Hi ,


Have one query . If we go like above ...and put asyncio call in continuous while loop ....will after 60 seconds the code will again request for new streaming.open() request and it will be counted as 1 more request or it will just keep the current stream open and will not count it as a seperate request. This i'm asking in context of the number of streaming.open requests we can send in a day ..Also in one request how many instruments i can send for streaming prices . I need to get the AT THE MONEY strike prices of a particular option during a session ...instead of subscribing to all strikes is there a way i can subscribe to ATM strike RIC's in between the session ...I have used above streamingPrices open request only at start of the session .


Thanks

Sumit

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.