API Documentation

NxTime Usage

The struct NxTime is a member of 3 structures in NxCoreAPI:

    1. NxCoreSystem, where the member nxTime defines the Nanex Clock which has a resolution of 1 millisecond.
    2. NxCoreHeader, where the member nxExgTimestamp defines the current exchange timestamp for a Quote, Trade or Category message, and commonly has a resolution of 1 millisecond.
    3. NxCategoryField, where the member nxTime is used whenever a time quantity is being defined, the most common type being "LastTradeTime".

NxCore 1.x (.nxc files) do NOT contain 1 millisecond resolution for either NxCore normalized or exchange timestamps.

NxCore 2.x (.nx2 files) include exchange timestamps to 1 millisecond resolution with the NxCore normalized clock remaining at 25ms.


NxTime is defined in NxCoreAPI.h as:

struct NxTime {
    unsigned int  MsOfDay;
    unsigned short Millisecond;
    unsigned char  Hour;
    unsigned char  Minute;
    unsigned char  Second;
    char  TimeZone;
    unsigned short MsResolution;
    unsigned char  alignment[4];

NxTime members

Member Type Min Max Description
MsOfDay unsigned
0 86,400,000 MsOfDay represents the total number of milliseconds from the start of the day. It will always equal NxTime.Hour*3600000 + NxTime.Minute*60000 + NxTime.Second*1000 + NxTime.Millisecond.
Millisecond unsigned
0 1,000 Millisecond represents the millisecond of the current second. It will be zero if the MsResolution member is 1000 or higher.
Hour unsigned
0 23 Hour represents current hour of the day in military format (0-23). For example: at 9am, the Hour would be 9, at 12:15am, the hour would be 0, at 12:15pm, the hour would be 12.
Minute unsigned
0 59 Minute represents current minute of the hour. At 9:00am, minute would be 0. At 9:59am, minute would be 59.
Second unsigned
0 59 Second represents current second of the minute. At 9:00:00 second would be 0. At 9:59:59 second would be 59.
TimeZone char -23 +23 TimeZone represents the number of whole hours from GMT. All NxTime structures use Eastern EDT during Daylight Savings Time (March - November), making TimeZone -4, and Eastern Standard time the rest of the year making TimeZone -5.
MsResolution unsigned
0 1000 MsResolution defines the current lowest resolution of the clock in Milliseconds. That is, the shortest possible time between updates. NxClock is currently set to 1 representing 1 milliseconds between clock updates.
alignment unsigned
0 0 This member pads the struct for correct alignment