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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 1 2 4

get_data on delisted stock

hi why does this line of code fail using get_data for a delisted stock but works of other listed stocks

dfmcap2, err = ek.get_data(['JCI^I16'],['TR.CLOSEPRICE.date','TR.CLOSEPRICE(Adjusted=0)'],{'SDate':sd, 'EDate':ed, 'Curn':'USD'})

I can get the data using get_timeseries but this ofcourse has the 3k lines problem.....

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
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
39.2k 75 11 27

The unadjusted price history is not available with TR.PriceClose field. You can get it using TR.CLOSEPRICE, but you need to ensure the range of dates in your request overlaps with the range of dates for price history available. This stock was delisted on 3-Sep-2016. The following call returns the last two closing prices available for this stock:

ek.get_data(['JCI^I16'],['TR.CLOSEPRICE.date','TR.CLOSEPRICE(Adjusted=0)'],{'SDate':'2016-09-01', 'EDate':'2016-09-05'})

If you need to determine the range of price history available you can either infer it from the symbol ("^I16" in the symbol signifies that the stock was delisted in Sep 2016). Or you can use TR.PriceClose field per the example provided by @Zhenya Kovalyov, which returns the last available price close date.

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
4.6k 26 7 22

Use this:

df, e = tr.get_data(['JCI^I16'],['TR.PriceClose'])


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, is it possible to include the "Adjusted" parameter....that is the key part for me and seems to make it fail.

Click below to post an Idea Post Idea