NxCategoryField
The structure NxCategoryField is defined in NxCoreAPI.h as:
struct NxCategoryField { const char* FieldName; const char* FieldInfo; unsigned char Set; unsigned char FieldType; unsigned char alignment[6]; union { // field is ONE of the following depending on 'FieldType' member. __int64 i64Bit; // FieldType == NxCFT_64BIT (1) int i32Bit; // FieldType == NxCFT_32BIT (2) const char* StringZ; // FieldType == NxCFT_STRINGZ (3) double Double; // FieldType == NxCFT_DOUBLE (4) NxPrice nxPrice; // FieldType == NxCFT_PRICE (5) NxDate nxDate; // FieldType == NxCFT_DATE (6) NxTime nxTime; // FieldType == NxCFT_TIME (7) NxString* pnxString; // FieldType == NxCFT_NxSTRING (8) StringTableItem stringTableItem; // FieldType == NxCFT_STRING_IDX (9) or NxCFT_STRING_MAP (10) } data; };
A null-terminated ASCII string for the name of the field.
Contains any comments about the field, may be empty
Has the value 1 if the field has valid data. The value 0 means the data member is not present.
It is important to note that some categories come through more than once per day. These categories might not contain data in every field, so it is imperative to check the "Set" flag to prevent clearing/modifying data unneccessarily.
For more information on the "Set" flag, review the NxMSG_CATEGORY documentation.
Indicates which union member to use to interpret the data. Each field will be one of the following types:
# | Field #define | Type | Name | Comment |
---|---|---|---|---|
1 | NxCFT_64BIT | __int64 | i64Bit | Used mostly for Total Volume and fields that may exceed 32 bits |
2 | NxCFT_32BIT | int | i32Bit | Very common. Used for most numbers that are not prices. |
3 | NxCFT_STRINGZ | const char* | StringZ | null-terminated ASCII string. Used for Company Names, etc. |
4 | NxCFT_DOUBLE | double | Double | Currently, not used for any field in any category. |
5 | NxCFT_PRICE | NxPrice | nxPrice | A simple structure containing a 32 bit price with the decimal place indicated by PriceType. |
6 | NxCFT_DATE | NxDate | nxDate | The structure NxDate used for expiration dates, dividend/split dates, etc. |
7 | NxCFT_TIME | NxTime | nxTime | The structure NxTime used for last trade time, quote times, etc. |
8 | NxCFT_NxSTRING | NxString* | pnxString | A pointer to an NxString. Used mostly by Options for a direct link to the underlying. |
9 | NxCFT_STRING_IDX | StringTableItem | stringTableItem | The structure StringTableItem which indicates the table, and index for a defined string. |
10 | NxCFT_STRING_MAP | StringTableItem | stringTableItem | Same as NxCFT_STRING_IDX, but index is a series of 32 bits, one for each string in a defined table. |
Union of all possible values, selected by FieldType.
Example
For example of category usage see here