CF_DATE comes as a number of days from Jan 1, 1901 in double (why?) type...
Is there a way to get it in string format?
Python API returns string.
And more general question about the COM API: why do API return the values of the same field in different format for different tickers?
Example 1: CF_DATE is an empty string when is not available, but otherwise - doube
Example 2: TR.VWAP (TR.Close, TR.HIGH) is a double value, but 'NULL' string value if not available for a ticker. Why not just 0?
> In the 1900 date system, dates are calculated by using January 1, 1900, as a starting point. When you enter a date, it is converted into a serial number that represents the number of days elapsed since January 1, 1900.
You can convert it to a date in code fairly easily depending on what environment you use.
COM API is an ease-of-use API that was designed with VBA and Variant type in mind. If you use C++ or .NET with this API, you can run into type casting issues like the one you are describing above.
Returning 0 values for numeric fields is confusing, if an instrument is quoted in points or is a very low interest rate, 0 can be a legitimate HIGH or CLOSE price.
Eikon COM APIs are targeted primarily for use in MS Office VBA and are meant to be most friendly for Excel users. This is why the dates are returned in OLE Automation date format, which is the date format Excel uses. The logic behind the dates returned as strings when not available is to force the type mismatch error rather than to allow zero to propagate into calculations that may return incorrect result to an unsuspecting user. In other words this logic was built with the view that in financial calculations error is better than incorrect result.