Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
7 4 5 8

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-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apic#
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
77.5k 242 52 72

@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 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.