Eikon API - results incorrect for RICs at the BACK of list when multiple RICs requested

Using VS2022 C# EikonDataAPI 0.4.9. I have an issue when requesting data for multiple RICs, if a RIC is toward the end of the list then the results are sometimes incorrect. I've stripped it down to a basic example (https://github.com/TokyoDerm/eikon_api_issue). The output I get from this program is below. The result when the test RIC is at the front of the list is correct, $0.24. When the test RIC is at the back of the list then it returns zero.

EMBE132209700.U CLOSE_ASK=0.24 [FRONT of list]
EMBE132209700.U CLOSE_ASK=0 [BACK of list]

The problem is not 100% reproducible from one day to the next so, if possible, please try to check this out today. Also, FYI I tried it with two separate accounts with the same results. Please advise if you can reproduce it on your side and if you can advise a solution. Thanks!


Tagged:

Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    @DDALY

    The problem happens when converting the JSON to Deedle dataframe.

    The first item contains an integer (5) so all data in this column will be an integer. Therefore, it will change a floating-point value (0.35) to an integer (0).

    I will look at the code and find a way to fix it.

Answers

  • @DDALY

    Please enable the debug log in the API so we can verify the raw response. You need to add Microsoft.Extensions.Logging.Console 2.2.0.0.

    The code looks like this:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using EikonDataAPI;
    using Deedle;
    using Microsoft.Extensions.Logging;

    namespace EDAPIDotnetFramework
    {
        internal class Program
        {
            static void Main(string[] args)
            {
                IEikon eikon = Eikon.CreateDataAPI();
                eikon.GetLoggerFactory().AddConsole(LogLevel.Debug);
                eikon.SetAppKey("app key");
                Frame<int, string> data;
                string testRic = "EMBE132209700.U";
                string testField = "CLOSE_ASK";
                // 19 option rics
                var baseList = new List<string>() { "EDQ202209750.U", "EEMM192404600.U", "EEMR172204500.U", "EGLEE202206500.U", "EGLER172204000.U", "EIXM202306000.U", "EIXQ202207000.U", "ELA202335000.U", "ELE202226000.U", "ELE202227000.U", "ELE202228000.U", "ELE202229000.U", "ELE202231000.U", "EMBA192408900.U", "EMBA202309500.U", "EMBE132209100.U", "EMBE132209350.U", "EMBE202209400.U", "EMBG152209000.U" };
                var testRicList = new List<string>() { testRic };
                var fields = new List<string>() { testField };
                // create list of 20 rics with testRic being the first in the list
                var frontOfList = testRicList.Concat(baseList);
                data = eikon.GetData(frontOfList, fields);
                var closeAskFront = data.Rows[0][testField];
                Console.WriteLine($"{testRic} {testField}={closeAskFront} [FRONT of list]");
                // create list of 20 rics with testRic being the last in the list
                var backOfList = baseList.Concat(testRicList);
                data = eikon.GetData(backOfList, fields);
                var closeAskBack = data.Rows[19][testField];
                Console.WriteLine($"{testRic} {testField}={closeAskBack} [BACK of list]");
                Console.ReadLine();
                return;
            }
        }
    }

    Then, we can verify the raw response.

    1652327780961.png

  • Jirapongse, Thanks for getting back. I'm using .NET Framework 4.6.1 which does not support the logging code above. I did upgrade the sample app to use .NET Core 3.1 and confirmed that it actually fixes the problem but the bad news is, I can't upgrade my own app (I tried!) due to dependent libraries. So I'd like to find a solution with .NET Framework 4.6.1 if that's possible. Please advise how I can get you the diagnostics you require on that version.

  • @DDALY

    You can use the GetDataRaw method instead. This method will return a string.

    Then, check the value or compare it with .NET Core 3.1 application. To compare the data, you need to run the applications at the same time.

    1652774750332.png

  • @Jirapongse, Ok progress - on .NET Framework 4.6.1, GetRawData() actually returns the correct data but GetData() doesn't. Below is the Deedle Frame returned from GetData() and also the string returned from GetRawData(). Any ideas? Thanks.

    1652783242992.png

  • Ah right... yes makes sense. I'll wait to hear back on a fix. Thank you!
  • @DDALY

    Please try Version 0.5.0.

  • @Jirapongse, Version 0.5.0 fixed it. Impressive turnaround time.. Thank you!