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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
45 3 5 10

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!

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythondata
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.

1 Answer

Upvotes
Accepted
3.8k 4 4 6

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.

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

ahs.jpg (13.6 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.

@marcin.bunkowski Excellent! Many thanks!!

Been looking for that for a while.. found it way too late :(
I've also used the page solution to access this information, but couldn't find the RIC to divcf transformation rule at the time, so I had to look for them individually and hardcode the list in my scripts.
The transformation is hidden inside GetRicRules, but impossible to access the source of it. Your answer was the key to understand how the transformation was done.

Please consider adding a TR. field for this as well, it would be way nicer for implementations.

Click below to post an Idea Post Idea