Dividend-Adjusted Historical Prices

Pasa
Pasa Newcomer
edited February 10 in Eikon Data APIs

Hi,

If I want to derive the "TR.TotalReturn" measure myself, how can I do this, and which data points do I need? I want to extract the fields needed to derive "TR.TotalReturn". I tried extracting "TR.PriceClose" and calculate the price return as follows: (P_t / P_t-1)-1. However, there are some minor deviations comparing this to the TR.TotalReturn measure, as TR.TotalReturn includes dividends.

Can you provide an example on how to do this by updating the code below?

ld.get_data(universe='GOOGL.O', fields=["TR.TotalReturn.CalcDate", "TR.TotalReturn"], parameters={'SDate': '2010-12-31', 'EDate': '2020-12-31', 'Frq': 'D'}, header_type=ld.HeaderType.NAME)

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @pasachon.parikumsin

    Thank you for reaching out to us.

    To get adjusted prices, you can try the TR.ClosePrice field instead. This field supports the Adjusted parameter.

    df = ld.get_data(
            universe = ['GOOGL.O'],
            fields = ['TR.ClosePrice(Adjusted=0)','TR.ClosePrice(Adjusted=1)'],
            parameters = {'SDate': '2010-12-31', 'EDate': '2020-12-31', 'Frq': 'D'})
    
    df
    

    Otherwise, you can also the get_history method to get adjusted prices. The example is on GitHub.

    df = ld.get_history(universe=['GOOGL.O'],
        fields = ['TRDPRC_1'],
        adjustments=['exchangeCorrection','manualCorrection','CCH','CRE','RPO','RTS'],
        start='2010-12-31',
        end='2020-12-31')
    df
    

    However, for the quesiton regarding the calculation of the TR.TotalReturn field, please contact the helpdesk team directly via MyAccount.