AdxRtList CF_DATE format

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?

Thanks,

Igor

Best Answer

  • Zhenya Kovalyov
    Answer ✓

    @igorg CF_DATE is represented in the Excel (1900) date format:

    > 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.

Answers