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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
7 2 2 6

How can I get dividend data and stock splits in C#

Hi, I am currently using the following function to get the OHLC data for a timeseries:

request = timeSeries.SetupDataRequest(ric)
     .WithView("NDA_RAW")
     .WithAllFields()
     .WithInterval(CommonInterval.Daily)
     .WithAdjustedPrice(false)
     .From(dt)
     .OnDataReceived(DataReceivedCallback)
     .CreateAndSend();


I now want to get the dividends and stock splits.

I can do that in excel:

=TR("AAPL.O","TR.DivUnadjustedNet;TR.DivUnadjustedGross","SDate=2010-01-01 EDate=2019-10-24 CH=Fd RH=IN;coraxdividenddate;paymenttype")

or

=TR("AAPL.O","TR.DivUnadjustedNet;TR.DivUnadjustedGross","SDate=2010-01-01 EDate=2019-10-24 CH=Fd RH=IN;coraxdividenddate;paymenttype")


How do I do the same in C#?

Thanks

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonc#
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
38.1k 71 35 53

@jerome

To retrieve TR fields with C#, you can use the following APIs:

1. DEX2 from COM APIs for use in custom applications

2. Or the GetDataRaw method in NET Libraries for Eikon Data APIs

For NET Libraries for Eikon Data APIs, the code is:

            eikon = Eikon.CreateDataAPI();
            eikon.SetAppKey("<app key>");
           
            var data = eikon.GetDataRaw(
               new List<string>
               {
                    "AAPL.O"
               },
               new List<string>
               {
                    "TR.DivDate",
                    "TR.DivPaymentType",
                    "TR.DivUnadjustedNet",
                    "TR.DivUnadjustedGross"
               },
               new Dictionary<string, string>
               {
                    { "SDate", "2010-01-01" },
                    { "EDate", "2019-10-24" },
                    { "Frq", "D" }
               });
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.

Click below to post an Idea Post Idea