TR.SharesOutstanding API rounding

Hello,
I am trying to fetch TR.SharesOutstanding for RIC FKR.MI^E22 via eikon API (C#), but it seems results are rounded by thousands comparing results from eikon excel. Could you advise how to disable rounding please?
Best Answer
-
Eikon Data API .NET uses the DataFrame.LoadCSV function to create a DataFrame from CSV content.
The DataFrame.LoadCSV function uses System.Single for the values of TR.SharesOutstanding which causes the data to be rounded.
I have submitted this issue to the Microsoft.Data.Analysis team to investigate and fix this issue.
For the workaround, you need to call the GetDataRaw method to get the raw data and then convert the raw data to the data frame. The code looks like this:
List<string> fields = new List<string> {
"TR.SharesOutstanding",
"TR.SharesOutstanding.date"
};
Dictionary<string, string> parameters = new Dictionary<string, string> {
{"SDate", "1D"},
{"EDate", "-7AY"},
{"RH", "IN"}
};
List<string> RICs = new List<string> { "FKR.MI^E22" }; // more RICs in the original code
var fetchedData = eikon.GetDataRaw(RICs, fields, parameters);
var dataResponses = JsonConvert.DeserializeObject<DataResponses>(fetchedData, new JsonSerializerSettings
{
});
var response = dataResponses.responses[0];
var col1 = response.data.Select(x => x[0]).ToList();
var col2 = response.data.Select(x => x[1]).ToList();
var col3 = response.data.Select(x => x[2]).ToList();
StringDataFrameColumn ric = new StringDataFrameColumn(response.headers[0][0].displayName,col1.Select(x => x.ToObject<string>()).ToList());
PrimitiveDataFrameColumn<int> data = new PrimitiveDataFrameColumn<int>(response.headers[0][1].displayName, col2.Select(x => x.ToObject<int>()).ToList());
PrimitiveDataFrameColumn<DateTime> date = new PrimitiveDataFrameColumn<DateTime>(response.headers[0][2].displayName, col3.Select(x => x.ToObject<DateTime>()).ToList());
var df = new DataFrame(ric, data, date);
Console.WriteLine(df);The output is:
0
Answers
-
Hi @d.fecher
Please share code snippets you are using
0 -
when I use the following formula in excel API for the RIC - FKR.MI^E22 :
=TR(P5,"TR.SharesOutstanding, TR.SharesOutstanding.date","SDate=1D EDate=-7AY RH=IN")
it brings me for the first row:
Instrument Outstanding SharesDate
FKR.MI^E22 289203891 17/05/2022 00:00:00
and using eikon API code below:
IEikon eikon = Eikon.CreateDataAPI()
eikon.SetAppKey("XXXXXXXXX");
List<string> fields = new List<string> {
"TR.SharesOutstanding",
"TR.SharesOutstanding.date"
};
Dictionary<string, string> parameters = new Dictionary<string, string> {
{"SDate", "1D"},
{"EDate", "-7AY"},
{"RH", "IN"}
};
List<string> RICs = new List<string> { "FKR.MI^E22" } // more RICs in the original code
var fetchedData = eikon.GetData( RICs , fields, parameters);
Console.WriteLine(fetchedData);
Console.WriteLine(fetchedData[0,1]); // just to see the value separately (it is still rounded)I get the following result for the first row (the values are also rounded in the following rows) :
Instrument Outstanding SharesDate
FKR.MI^E22 289203900 17/05/2022 00:00:00
I also tried to add a setting for Scale in the parameters Dictionary (with different values for scale), but still did not get the exact value as in excel API
{ "Scale", "0" }
0 -
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 614 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 248 ETA
- 554 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 641 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 192 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 89 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛