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.....

Best Answer

  • Alex Putkov.1
    Answer ✓

    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.

Answers

  • Use this:

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

    image

  • thanks. is it possible to also use the Adjusted field to get prices adjusted for corporate actions…..that is the key part for me....

  • thanks, is it possible to include the "Adjusted" parameter....that is the key part for me and seems to make it fail.