How to get in C# the same data as in Python with eikon.get_timeseries

Hello,

It seems that historical data from some RICs are different when extracted through the Eikon Terminal Instrument Explorer, vs Excel Add-in, vs the Python eikon API, when I would expect them to be the same.

What is the exact C# code which I need to use to get the exact same data which is outputted by the Python code below?

import eikon as ek

ek.get_timeseries(['GFRUKBWE1'], ['Value'], start_date=None, end_date=None, interval='tick', count=1000000)

Thank you

Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    @mjs

    The data retrieved by Eikon Data API .NET is similar to the data retrieved by the Python library.

    1639738663147.png

    You may need to contact the content support team directly via MyRefinitiv to clarify it.



Answers

  • @mjs

    Please share the code and library that you are using.


  • It seems that there is a function in C# which seems equivalent to python: eikon.GetTimeSeries() - see first snapshot.

    One issue I have found is that the data seems to be duplicated at a very short time intervals - see second snapshot. What could be causing those artefacts?

    image-11.png

    image-10.png

  • We are now using the newer EikonDataApi for C# but the python output seems to be doubling up the results.




    Python code is here:


    # coding: utf-8__version__ = "1.1.14"

    """ Eikon Data API for Python allows your Python applications to access Refinitiv data directly from Eikon. Its usage requires: - An App Key (you can create it wit App Key Generator in Eikon Desktop) - Eikon Desktop or Refinitiv Workspace application running on your local machine

    """

    from .Profile import *from .symbology import get_symbologyfrom .json_requests import send_json_requestfrom .news_request import get_news_headlines, get_news_storyfrom .time_series import get_timeseriesfrom .data_grid import get_data, TR_Fieldfrom .eikonError import EikonErrorfrom .streaming_session import *


    dfT = ek.get_timeseries(r, ['Value', 'Volume'], start_date=dS, end_date=dE, interval='tick', count=1000000) #Market Orders (Best B/A): when each trade happens


    Python result example for RIC GFRUKBWE1

    python





    2021-12-02 13:05:11.717000+00002072021-12-02 13:05:11.758000+00002072021-12-02 13:05:11.814000+00002072021-12-02 13:05:11.859000+00002072021-12-03 07:56:29.808000+00002022021-12-03 07:56:29.854000+00002022021-12-03 07:56:30.048000+00002022021-12-03 07:56:30.094000+00002022021-12-10 08:04:30.566000+00002142021-12-10 08:04:30.840000+00002142021-12-10 08:08:34.596000+0000216.52021-12-10 08:08:34.749000+0000216.52021-12-10 08:37:55.355000+00002142021-12-10 08:37:55.565000+00002142021-12-13 10:31:29.978000+00002652021-12-13 10:31:30.024000+00002652021-12-13 10:31:30.198000+00002652021-12-13 10:31:30.248000+00002652021-12-13 16:29:28.807000+00002672021-12-13 16:29:28.853000+00002672021-12-13 16:29:29.147000+00002672021-12-13 16:29:29.196000+0000267




    C#

    EikonDataApi 0.4.7

    Using 4.7.2 Framework

    1639740084847.png



    IEikon eikon = Eikon.CreateDataAPI();

    eikon.SetAppKey(xxx);

    var data = eikon.GetTimeSeries(

    "GFRUKBWE1", //a single RIC to retrieve historical data for

    new DateTime(2021, 12, 1), //starting date of the historical range

    new DateTime(2021, 12, 17) //end date of the historical range

    , Interval.tick);



    C# Result:


    SecurityTIMESTAMPVALUE

    VOLUME->GFRUKBWE102-Dec-2113:05:11207<missing>->GFRUKBWE102-Dec-2113:05:11207<missing>->GFRUKBWE103-Dec-2107:56:29202<missing>->GFRUKBWE103-Dec-2107:56:30202<missing>->GFRUKBWE110-Dec-2108:04:30214<missing>->GFRUKBWE110-Dec-2108:04:30214<missing>->GFRUKBWE110-Dec-2108:08:34216.5<missing>->GFRUKBWE110-Dec-2108:08:34216.5<missing>->GFRUKBWE110-Dec-2108:37:55214<missing>->GFRUKBWE110-Dec-2108:37:55214<missing>->GFRUKBWE113-Dec-2110:31:29265<missing>->GFRUKBWE113-Dec-2110:31:30265<missing>->GFRUKBWE113-Dec-2116:29:28267<missing>->GFRUKBWE113-Dec-2116:29:29267<missing>->GFRUKBWE116-Dec-2111:58:49295<missing>->GFRUKBWE116-Dec-2111:58:49295<missing>->GFRUKBWE116-Dec-2113:28:35305<missing>->GFRUKBWE116-Dec-2113:28:35305<missing>





  • Might be easier to read: Python version is has 2 of the same outputs with slightly different timestamps


    1639740421131.png