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
-
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)
output0
Answers
-
@marcin.bunkowski Excellent! Many thanks!!
0 -
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.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛