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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
242 1 3 1

Get Relevant Stock Index

How do I get the relevant stock index closing price starting from a Ultimate Parent Id in order to get Abnormal Returns? Is there a field I can add that I am unable to find on DIB?


bonds, err = ek.get_data(
    identifiers,
    ['TR.ClosePrice.date', 'TR.ClosePrice'],
    {'SDate': starting_date,
     'EDate': ending_date})


eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythontime-seriesindexmarket-by-price
icon clock
10 |1500

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

Upvotes
Accepted
18k 21 12 20

Hi @lorenzo.cerreta

I am not sure of the "relevant" meaning but if you mean peers of a stock.

You can use PEERS() function on ADC.

Here is an example to get list of peers of "PTT.BK":


ahs.png (14.3 KiB)
icon clock
10 |1500

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

Thanks for the reply. What I mean is that if the parent ID is listed in the USA, I would like to get the S&P500 closing prices or even simply '#0.SPX', so that I can get the prices from the right code.

I would like to get it automatically because I need to do the same for many companies listed in

  
                   
  1. ['Australia', 'Austria', 'Belgium', 'Bermuda', 'Brazil', 'Canada', 'Cayman Islands', 'Chile', 'China (Mainland)', 'Colombia', 'Denmark', 'Finland', 'France', 'Germany', 'Hong Kong', 'India', 'Italy', 'Japan', 'Lithuania', 'Luxembourg', 'Mexico', 'Morocco', 'Netherlands', 'New Zealand', 'Nigeria', 'Norway', 'Peru', 'Philippines', 'Portugal', 'Singapore', 'South Africa', 'South Korea', 'Spain', 'Sweden', 'Switzerland', 'Taiwan', 'Thailand', 'Turkey', 'United Arab Emirates', 'United Kingdom', 'United States']

and I don't know the right index (nor the right code required by Refinitiv) for them

Upvote
18k 21 12 20

Hi @lorenzo.cerreta

I think you have to have your own mapping.

I found this TR.MemberIndexRic field from Data Item Browser.

But a RIC can be a member of multiple indexes.


ahs.png (79.4 KiB)
icon clock
10 |1500

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

Click below to post an Idea Post Idea