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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 1 2 2

Data items to get historical prices using ISIN for multiple asset classes

Hi,


I'm currently trying


prices = ek.get_data(codes,

['AVAIL(TR.PRICECLOSE.date,TR.FIPRICE.date,TR.NETASSETVAL.date),

AVAIL(TR.PRICECLOSE,TR.FIPRICE,TR.NETASSETVAL)'],

{'SDate':'2020-10-01', 'EDate':'2020-10-05'})


to get historical prices for equities, bonds, etfs and funds. Above codes is an array of ISIN codes.

All I get is <NA>.


Should I use some other data items? Or if you have working solution, that would be even better.


Thanks in advance.


BR, J



eikoneikon-data-apipythonworkspaceworkspace-data-apirefinitiv-dataplatform-eikondata-item-browser
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
Accepted
762 2 1 1

@juha.pomell, For funds not traded in exchanges (i.e. not ETFs) there is no closing price as it is not traded in exchanges. Thus you need to identify them and treat them separately. Most funds reports daily NAV, but few old style funds may report Bid/Offer prices and may only reporting weekly or monthly prices. Below is a sample code for getting historical price of a mutual fund (in funds' denominated currency):

Fund_NAV = ek.get_data('LP60000012',['TR.FundNAV.Date', 'TR.FundNAV'], {'SDate':'2019-01-01', 'EDate':'2019-05-10',\
 'Curn':'Native'})

Notes, Jason's symbology conversion may not work directly from ISIN to RIC for funds. If failed, you can try to firestly convert ISIN to LIPPERID, and then use LIPPERID to convert to RIC (or actually just Prefix the LIPPERID with "LP")

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
7.4k 10 6 8

@juha.pomell I couldn't find the field 'TR.FIPRICE' and the query was incorrectly formed - but try this:

codes = ['VOD.L','TSLA.O','LHAG.DE']

prices,err = ek.get_data(codes,['TR.PriceClose.date','TR.NETASSETVAL.date','TR.PRICECLOSE','TR.NETASSETVAL'],{'SDate':'2020-10-01', 'EDate':'2020-10-05'})

prices

The net asset value fields are empty as these would apply to funds in your list - i have only put in equities. You can use the Data Item Browser tool (type DIB into eikon search bar) to find fields available. I hope this can help.


1605198895583.png (78.5 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
3 1 2 2

HI Jason,


thanks for your reply.


Equities and using ric codes works nice. Problem is that I have list/array of ISIN codes. I can't make them work currently.

Any ideas to make it work?


J

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
15.2k 40 12 19

The problem in your query is the field TR.FIPRICE.date.

If you open Data Item Browser, you will see that this field is not a time series field. If you remove it, the output will work:

>>> df, err = ek.get_data(['IBM', 'LP40000259'], ['AVAIL(TR.PRICECLOSE, TR.NETASSETVAL)', 'AVAIL(TR.PRICECLOSE.date, TR.NETASSETVAL.date)'], {'SDate':'2020-10-01', 'EDate':'2020-10-05'})
>>> df
   Instrument  AVAIL(TR.PRICECLOSE, TR.NETASSETVAL) AVAIL(TR.PRICECLOSE.DATE, TR.NETASSETVAL.date)
0         IBM                                121.09                           2020-10-01T00:00:00Z
1         IBM                                120.57                           2020-10-02T00:00:00Z
2         IBM                                122.01                           2020-10-05T00:00:00Z
3  LP40000259                                 33.36                           2020-10-01T00:00:00Z
4  LP40000259                                 33.12                           2020-10-02T00:00:00Z
5  LP40000259                                 33.67                           2020-10-05T00:00:00Z


1605199702280.png (14.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
3 1 2 2

Hi,


Fantastic!


I'll give it try.


Many thanks guys.


BR, Juha



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
7.4k 10 6 8

@juha.pomell Please use our symbology conversion API :

df1 = ek.get_symbology(['GB00BH4HKS39'],from_symbol_type='ISIN',to_symbol_type='RIC')
df1

I hope this can help

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.