Dividen data and date data fields together in Python code

Hi,

I am trying to get both dividend data and date in time series using following:

df, err = ek.get_data(

instruments = ['HYG'],

fields = ['TR.DivAdjustedGross(EDate=-1AW,SDate=2013-01-01)']

)

It gets only dividend data but does not show date. How do I write query to fetch both date(when it was declared or distributed) and dividend

Regards,

RS

Best Answer

  • @rsharan

    There's a number of dates associated with each dividend, and there's a field name for each of those dates, e.g. TR.DivAnnouncementDate, TR.DivExDate, TR.DivPayDate, TR.DivPeriodEndDate etc. Use CodeCreator app in Eikon application to search the field names for the data items you're interested in and to help you construct the data retrieval expression.

    ek.get_data('HYG', ['TR.DivAnnouncementDate','TR.DivExDate',
    'TR.DivPayDate','TR.DivPeriodEndDate',
    'TR.DivAdjustedGross'],
                {'EDate':'-1AW', 'SDate':'2013-01-01'})

Answers