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
49 4 7 9

How could I adjust ek.get_timeseries in order to make it work for LAST_QUOTE.Close?

The following code gets data

ek.get_timeseries(rics=['ARSMPR=BCRA'], fields=["CLOSE"], start_date='2020-01-01',end_date= '2020-01-20', interval = 'daily'),
but the next one does not:

ek.get_timeseries(rics=['NGMPR='], fields=["LAST_QUOTE.CLOSE"], start_date='2020-01-01',end_date= '2020-01-20', interval = 'daily')


Via Excel add-in historical data for NGMPR= we could extract via the following formula:=RHistory("NGMPR=";"LAST_QUOTE.Timestamp;LAST_QUOTE.Close";"START:01-Jan-2020 END:31-Jan-2022 INTERVAL:1D";;"TSREPEAT:NO SORT:ASC CH:IN;Fd";B2)


How could I adapt it for the formula ek.get_timeseries?

eikon-data-apipython api
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.

1 Answer

· Write an Answer
Upvote
Accepted
14.9k 32 5 10

Hi @susskaya.anita

according to an answer in this thread, I'm following my colleague's suggestion and found that

the get_timeseries API call has a reduced datamodel - Open, High, Low, Close, Volume, Count. The Close field in that model is the same as CF_CLOSE - which you can find the description for in the Data Item Browser app. Unfortunately, you cannot use the get_timeseries API to request any other fields as a timeseries history. You can use the get_data api call to retrieve non-realtime field history. Something like this would usually work (it does not with the RIC you wanted - see the note below regarding this instrument):

df, err = ek.get_data('VOD.L', fields = ['TR.PriceClose.date','TR.PriceClose','TR.Volume'],parameters={'SDate':'2020-01-01','Frq':'D','EDate':'2022-01-31'}) df

1644407829493.png

We do however, have another route - which is the Refinitv Data Platform (RDP) APIs and their accompanying ease of use RDP Libraries (Python, Typescript and a community supported .NET version). Eikon users have access to many new services there such as Search APIs, Instrument Pricing and Analytics APIs & much more, and importantly in your case Historical Pricing APIs - these have an enhanced realtime data model of about 30 fields instead of the reduced get_timeseries data model. You can see examples of how to get started (pip install refinitiv.dataplatform) in the links above. You could try something as simple as:

import refinitiv.dataplatform as rdp import pandas as pd import numpy as np session = rdp.open_desktop_session('YOUR EIKON APP KEY HERE') rdp.get_historical_price_summaries('VOD.L')

1644407947816.png

Now, unfortunately - the RIC you were initially looking for NGMPR= is not yet available via this service, but many others will be - so it may help you in the future.

However, ticket number 10930190 has been raised to a content specialist via MyRefinitiv asking for the suggestion of the proper field to get LAST_QUOTE.Close price of RIC "NGMPR=" using =@TR excel formula (which can be converted to Eikon Data API get_data function) and the support team is going to contact you soon.

I hope this can help.


1644407829493.png (28.3 KiB)
1644407947816.png (114.7 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.

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.