Forecast Dividends for Next 12 months using python API

I am looking to create a projected cashflow based on upcoming dividends over next 12 months. I tried

ek.get_data(riclist, fields=['TR.DivAdjustedNet','TR.DivPayDate', 'TR.DividendFrequency',
'TR.DivType'],
parameters = {'SDate':START, 'EDate':'12M',
'Curn' : CURRCODE, 'CH':'Fd', 'RH':'IN'})

This gave me a look forward till August - but I'm not getting a twelve month view. I wrote to the Helpdesk, who gave me a very helpful excel sheet which had a VBA code to pull the future cashflows. I asked for the Excel formula so I could code it in python, but got the following response

We do not have a direct datatype to get this data but we can use an excel function. Please the attached excel file where the codes are shown.
Also, if you want the VBA function to code this, we have our developers website where you can log your request and they will respond to you directly.
Please refer to the link: https://developers.refinitiv.com/home

Any help on how we can do this in python using the Eikon API? I have tried the responses in related links but haven't got anywhere!

Best Answer

  • m.bunkowski
    Answer ✓

    Hi @rajanraju

    The logic of Forecast Dividend Cash Flows is still available only through pages which makes it more difficult to find and navigate and not yet with TR. fields.

    Finding those pages is not straight forward as you need to know how to convert it to the RIC that hold Dividend Cashflow information. For that purpose you can use the file provided by Helpdesk. The same file can be also find in the Eikon Excel templates library as "Forecast Dividend Cashflow and At The Money Implied Volatility". The RIC transformation is visible in the tab 'Data'.

    If you are really keen on creating your own transformation tool, you can use the file that is delivered with Eikon installation - RicRules.kobra-configuration-file. Under "Forecast Dividend Cash Flow" you will find the transformation syntax.

    image

    In your example for <DBSM.SI> the RIC will be converted to<DBSMDIVCF.SI>

    Once you have that file you can parse the page with the example code

    Date = []
    Values = []


    for x in range (7,25,1):
    df,err = ek.get_data('DBSMDIVCF.SI','ROW80_'+str(x) )
    L=df.iloc[0,1]
    if not L.isspace():
    Date.append(L[10:21])
    Values.append(L[30:].strip())

    output = pd.DataFrame(list(zip(Date,Values)),columns=['Ex.Date','Dividend'])
    output['Ex.Date'] = pd.to_datetime(output['Ex.Date'],format='%d %b %Y')
    output['Dividend'] = results['Dividend'].astype(float)
    output

Answers