Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon Data APIs /
avatar image
Question by juha.pomell · Nov 12, 2020 at 03:27 PM · dibpython api formula screen multi instruments

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



People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

6 Replies

  • Sort: 
avatar image
Best Answer
Answer by b.lee · Nov 13, 2020 at 12:37 AM

@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")

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
Answer by jason.ramchandani · Nov 12, 2020 at 04:37 PM

@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)
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
Answer by juha.pomell · Nov 12, 2020 at 04:44 PM

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

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
Answer by Gurpreet · Nov 12, 2020 at 04:48 PM

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)
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
Answer by juha.pomell · Nov 12, 2020 at 04:51 PM

Hi,


Fantastic!


I'll give it try.


Many thanks guys.


BR, Juha



Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
Answer by jason.ramchandani · Nov 12, 2020 at 04:54 PM

@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

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
12 People are following this question.

Related Questions

List of Parameters of TR.FundInceptionDate

Extracting related securities from all quotes app

EIKON API Proxy on MacOS : DIB keeps loading

Is there a way to write a SCREEN formula for multiple instruments

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges