Retrieve dividend stock via Python Eikon API

In excel i am able to do the following query:

=TR(stockRIC,"TR.DivExDate;TR.DivType;TR.DivPaymentType;ZAV(TR.DivadjustedGross)","CH=Fd sdate=#1 edate=#2 curn=#3 SORTD=TR.DivExDate DateType=ED",$C$11:$F$92,sdate,edate,currency)

image

Which results in the following:

image

How can I do this in Python for a set of stocks? When I do a similar request in Python the dividend of 125 does not show, it give a 0 value.

Welcome!

It looks like you're new here. Sign in or register to get started.

Best Answer

  • anass.yazane.1
    anass.yazane.1 Contributor
    Answer ✓

    Hi

    Regarding your issue, you can used the following get_data function to retrieve the desired information

    >>> start='2019-01-01'
    >>> end='2019-03-11'
    >>> ric='PSN.L'
    >>> currency='GBp'

    data, err=ek.get_data(ric,['TR.DivExDate','Tr.DivType','TR.DivPaymentType','ZAV(TR.DivadjustedGross)'],parameters={'Sdate':start,'Edate':end, 'Curn':currency, 'dateType':'ED','SORTD':'TR.DivExDate'})

    Hope it help you.

Answers

  • mjones89
    mjones89 Newcomer

    Hi, thank you very much for the response. Very helpful. My apologies for the late reply, I was not able to easily find the page. Thanks again.

  • mjones89
    mjones89 Newcomer
    https://community.developers.refinitiv.com/discussion/comment/39728#Comment_39728

    Thank you for you help! It works and it is what I was looking for.

    One extra thing I would like to ask you is what the ZAV() is for? I found the query i posted in an Eikon excel template, but I do not really know what the ZAV() is for. Do you know?


    Thank you again for all your help.

    Cheers, Mick

  • Alex Putkov.1
    Alex Putkov.1 ✭✭✭✭✭
    https://community.developers.refinitiv.com/discussion/comment/40720#Comment_40720

    You can find these functions in Expression Editor in Formula Builder wizard in Eikon Excel. See screenshots below.

    image

    image

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.