For a deeper look into our Eikon Data API, look into:
Overview | Quickstart | Documentation | Downloads | Tutorials | Articles
If you just want to snap the Mid price as and when required you can use Eikon Data API get_data function e.g.
ek.get_data(instruments = 'VOD.L',fields = ['TR.MIDPRICE'])
You can get more information on the get_data function here:
If you want streaming data i.e. to be informed each time the mid price changes, then you can use the Streaming functionality as described here. There is a link to some examples at the bottom of that page.
Note that for Streaming data, not only will the field names will be different e.g. 'MID_PRICE' instead of TR.MIDPRICE - but also not all exchanges/asset classes provide a MID_PRICE - so you may have to calculate from the BID and ASK price.
I would like streaming for minute by minute for 60 minutes - I tested this out but could not find the solution.
E.g. 60 mins worth of minute bar for mid-price for EUR=... Is this possible or will it just update singular values upon changing?
Happy to talk offline if that's easier.
The streaming will send an update as and when the value changes in the market (allowing for conflation on the feed) - not at regular intervals.
Otherwise, you can use the get_data and control the timing yourself e.g. call the get_data method every 60 seconds.
Or, if you don't actually need the data streaming and just want the past 60 minutes of data then you might be able to use timeseries data.
data = ek.get_timeseries("EUR=", # the RICs count=60, interval = 'minute')
Whilst this actually returns HIGH,LOW,OPEN and CLOSE for each minute - a quick observation seemed to suggest the HIGH price is the highest MID price - you will need to check with the Content helpdesk to confirm if this is indeed the case.
You could also try something like this for get_data approach if the get_timeseries does not work out:
starttime=time.time() while time.time() < (starttime+3600): mid = ek.get_data(instruments = 'VOD.L', fields = ['TR.MIDPRICE']) print(mid) time.sleep(60.0 - ((time.time() - starttime) % 60.0))