API Documentation

NxCoreHeader

The structure NxCoreHeader is defined in NxCoreAPI.h as:


struct NxCoreHeader {
    NxString*       pnxStringSymbol;
    NxOptionHdr*    pnxOptionHdr;
    NxDate          nxSessionDate;
    NxTime          nxExgTimestamp;
    unsigned short  ListedExg;
    unsigned short  ReportingExg;
    unsigned char   SessionID;
    unsigned char   alignment;
    unsigned short  PermissionID;
};

pnxStringSymbol

Pointer to a structure of type NxString, which is basically a String with several key features. The NxCore Feed prepends a single lower case symbol type character to the exchange specified symbol name, which you can ignore simply: pnxStringSymbol->String+1. For example, International Business Machines is assigned the string 'IBM' by the NYSE. Nanex prepend the symbol with an 'e' indicating that it is an equity, so the pnxStringSymbol->String will point to the string "eIBM", and pnxStringSymbol->String+1 will point to "IBM".


int __stdcall OnNxCoreCallback(const NxCoreSystem* pNxCoreSys, const NxCoreHeader* pNxCoreMsg)
{
    if( strcmp(pNxCoreMsg->coreHeader.pnxStringSymbol->String,"eIBM") ) // example 1
        return; // skip this, it's not IBM

    if( strcmp(pNxCoreMsg->coreHeader.pnxStringSymbol->String+1,"IBM") ) // example 2
        return; // skip this, it's not IBM
}

The list of prefix characters can be found at here. The following code illustrates one way to use the symbol type character:


int __stdcall OnNxCoreCallback(const NxCoreSystem* pNxCoreSys, const NxCoreHeader* pNxCoreMsg)
{
    if( pNxCoreMsg->coreHeader.pnxStringSymbol->String[0] == 'o' )
        return processOptions(pNxCoreSys,pNxCoreMsg);
}

The NxString pointer value of pnxStringSymbol is an address that will not change for the duration of processing an NxCore Tape. You can take advantage of this and store the NxString pointer itself in your code rather than allocate your own space and copy the contents, saving you a considerable about of memory and cpu time. Other special properties for members with the prefix pnxs and pnxString (both are used to identify NxStrings) are discussed in NxString.

pnxOptionHdr

Contains a pointer (could be NULL) to the NxOptionHdr information if this is an option contract.

nxSessionDate

nxSessionDate is an NxDate structure which contains the date of the Session that the message applies to. For real-time messages (especially ExgQuote, and MMQuote messages), this date will equal the current date for most symbols. For a few futures contracts that have sessions beginning in the afternoon and spanning midnight, the SessionDate will equal be set to the next day which is the exchange convention. Several dozen Dow Jones Indexes also switch to the next day's session at/near 4:15pm Eastern.

At the beginning of each tape, Category messages carrying information about the previous trading session will have a nxSessionDate corresponding to the previous trading session date. For those instruments that do not trade often, that date could be several weeks or months earlier, so be sure to pay attention to this data member.

nxExgTimestamp

nxExgTimestamp is an NxTime structure containing the Timestamp sent by each Exchange for ExgQuotes, MarketMaker Quotes, and Trades. For .nxc tapes, the resolution is usually 1 second, for .nx2 tapes, the resolution is usually 1 millisecond, and for .nx3 tapes the resolution is usually 1 microsecond, subject to per-exchange availability. It is always in Eastern Time, US. Each exchange's timestamp has its own peculiarities; some will occasionally jump back in time, while some exchange timestamps will appear to be a few seconds ahead or behind other exchange timestamps. The NxCore Feed Timestamp contained in NxCoreSystem.nxTime is available for comparison and reference with each ExgQuote, MarketMaker Quote, and Trade message. The NxCoreSystem.nxTime is synchronized to within milliseconds, whereas some Exchange Timestamps are notoriously off by seconds.

ListedExg

Identifies the Exchange where the instrument is listed. Read more about how to use Listed Exchange.

ReportingExg

Identifies the Exchange where the a trade or quote originated. Read more about how to use Listed Exchange.

SessionID

SessionID is used to identify the trading session the message applies to. Most symbols only have one trading session, so the SessionID will remain constant (0). A list of SessionIDs can be found here.

PermissionID

PermissionID is a number assigned by Nanex and pertains to the authorization group that the message belongs to. PermissionIDs are usually a subset of an Exchange. For example, NASDAQ quotes have a different permissioning unit than NASDAQ trades, and NASDAQ level 2 quotes, have another PermissioningID.