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
1 0 0 0

Not same fields available from .Net vs Python for get_history

Hello,

It seems that we cannot query the same fields for historical prices from Python and .Net.

We would like to query TR.TotalReturn in the .Net C# API as such :

var response = Summaries.Definition(new List<string>() {"0001.HK"})
                        .Fields(new List<string>() {"TR.TotalReturn"})            
                        .Interval(Summaries.Interval.P1D)             
                        .GetData();

But it seems this is not in the available fields

From Python we are able to do it using the get_history

Can you please help to check how we can get the TR.TotalReturn history via C# .Net API?

Thanks.

eikon-data-apirefinitiv-dataplatform-eikon#product
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
84.6k 287 53 77

@cleesikyee

Thank you for reaching out to us.

To get the TR fields, you can use the FundamentalAndReference. Please check these examples.

The code looks like this:

var sdate= "2024-06-01";
var edate = "2024-06-30";
response = FundamentalAndReference.Definition().Universe("0001.HK")
                                               .Fields("TR.TotalReturn.Date","TR.TotalReturn")
                                               .Parameters(new Newtonsoft.Json.Linq.JObject()
                                               {
                                                   ["SDATE"] = sdate,
                                                   ["EDATE"] = edate,
                                                   ["FRQ"] = "D"
                                               }).GetData();

You can use the Data Item Browser tool to search for fields and parameters.

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.

Hello Jirapongse,

Thanks for your reply.

I tried the above and it does give values but it seems that sometimes some duplicated values.

var sdate = "2023-08-30";
var edate = "2023-09-10";
response = FundamentalAndReference.Definition().Universe("0001.HK")
                                               .Fields("TR.PriceClose.Date","TR.PriceClose")
                                               .Parameters(new Newtonsoft.Json.Linq.JObject()
                                               {
                                                   ["SDATE"] = sdate,
                                                   ["EDATE"] = edate,
                                                   ["FRQ"] = "D"
                                               }).GetData();

This is what we observe for example.

data.png

Can you check if you see the same?

From the Python API, the data is not duplicated.

Thanks.




data.png (25.0 KiB)

I checked in the Workspace Excel with the following formula.

=@RDP.Data("0001.HK","TR.PriceCloseDate;TR.PriceClose","Frq=D SDate=2023-08-30 EDate=2023-10-09 CH=Fd RH=IN",E2)

It also returns the duplicated entries.

1722851633357.png

Please contact the helpdesk directly via MyAccount to verify the retrieved data.

1722851633357.png (29.4 KiB)

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.