Table of Contents


    typedef int (__stdcall *NxCoreProcessTape) (const char* pszFilename, const char* pBaseMemory, unsigned int controlFlags, int UserData, NxCoreCallback stdcallback);
    #define cszNxCoreProcessTape "sNxCoreProcessTape"
    int __stdcall ProcessTape(const char*    filename,
                              const char*    baseMemory,
                              unsigned int   controlFlags,
                              int            userData,
                              NxCoreCallback callbackFunction);



Specifies the full path filename name of the NxCore Tape (or real-time stream, or state file) to process.

If Then
"" or NULL Loads real-time tape from NxCoreAccess executable's memory, requires NxCoreAccess.exe running
Path to tape file Loads specified historical tape, does not require NxCoreAccess.exe running
Path to state file Loads specified state, figures out the proper real-time or historical tape from the state, may require NxCoreAccess.exe running if state of real-time tape


Specifies the base memory address for NxCore to process data.
It is recommended that you pass a value of zero in this parameter.
(for additional details about baseMemory and it's usage click here)


Specify zero or more of one of the following control flags that will remain in effect for the entire processing of the NxCore Tape.

#define Value Action
NxCF_EXCLUDE_QUOTES 0x00000001 Exclude Exchange Quotes
NxCF_EXCLUDE_QUOTES2 0x00000002 Exclude MMQuotes
NxCF_EXCLUDE_OPRA 0x00000004 Exclude all option from OPRA (US)
NxCF_FAVOR_NBBO 0x00000008 Used by Nanex internally to process master tapes. No effect on regular tapes.
NxCF_MEMORY_ADDRESS 0x04000000 If set, memory is allocated (if possible) at the address specified by the 2nd parameter to ProcessTape (pBaseMemory)
NxCF_EXCLUDE_CRC_CHECK 0x08000000 Exclude CRC checking


The value of user data is copied to NxCoreSystem.UserData and is available to reference or change during your callback function.


The callback function that will be called for all messages when processing the NxCore Tape.

Return Value

Returns one of the following values as defined in NxCoreAPI.h

#define in NxCoreAPI.h Int Description
NxAPIERR_NO_ERROR 0 Tape completed normally
NxAPIERR_USER_STOPPED 1 NxCALLBACKRETURN_STOP was returned from callback function
NxAPIERR_NOT_CALLBACK_THREAD -1 Function was called from thread other than callback thread
NxAPIERR_BAD_PARAMETERS -2 Parameters are incorrect
NxAPIERR_EXCEPTION -3 An exception occurred
NxAPIERR_OPEN_TAPE_FILE_FAILED -4 Could not open the file specified as parameter 1
NxAPIERR_INITIALIZE_MEMORY_FAILED -5 Could not initialize memory. This can occur when calling processTape with a saved state file and the memory address used to save the state has been used by another dll or within your process.
NxAPIERR_NOLISTED_EXG -6 Symbol spin -- listed exchange does not exist in current tape
NxAPIERR_NOSYMBOLS_FOR_LSTEXG -7 Symbol spin -- no symbols of the type (options/not options) for the exchange specified
NxAPIERR_NOSESSION_FOR_SYMBOL -8 Symbol spin -- no session or session does not have data type
NxAPIERR_NODATATYPE_FOR_SESSION -9 Symbol spin -- There's a session, but no trade/quote/mmquote data for session
NxAPIERR_NODATA_FOR_REPEXG -10 Symbol spin -- MMQuotes. There is session data, but no entry for the specified rep. exg
NxAPIERR_ZEROED_DATA_FOR_SESSION -11 Symbol spin -- there is a session, but data is all zero
NxAPIERR_SAVE_STATE_IN_PROGRESS -12 Save state -- a state save is currently in progress
NxAPIERR_NOT_SUPPORTED -13 General error
NxAPIERR_INITALLOC_ERROR -14 Startup initial allocation error
NxAPIERR_NSODALLOC_ERROR -15 Startup pNxSOD allocation error


Here's an example of processing a tape

#include <windows.h>
#include <stdio.h>
#include <NxCoreAPI.h>
#include <NxCoreAPI_class.h>
NxCoreClass nxCoreClass;
struct XYZ
    int counter;
    XYZ() : counter(0);
int __stdcall nxCoreCallback(const NxCoreSystem* pNxCoreSys, const NxCoreMessage* pNxCoreMessage)
    XYZ *xyz = (XYZ*) pNxCoreSys->UserData;
int main(int argc, char** argv)
    if (!nxCoreClass.LoadNxCore("NxCoreAPI.dll") &&
        !nxCoreClass.LoadNxCore("C:\\Program Files\\Nanex\\NxCoreAPI\\NxCoreAPI.dll"))
        fprintf(stderr, "Can't find NxCoreAPI.dll\n");
        return -1;
    XYZ xyz;
    nxCoreClass.ProcessTape("", 0, NxCF_EXCLUDE_CRC_CHECK, (int) &xyz, nxCoreCallback); // realtime
// or
    nxCoreClass.ProcessTape("C:\\NxCoreData\\20081105.CA.nxc", 0, NxCF_EXCLUDE_CRC_CHECK, (int) &xyz, nxCoreCallback); // tape
// or
    nxCoreClass.ProcessTape("C:\\NxCoreData\\20081105.CA.1000.nxs", 0, NxCF_EXCLUDE_CRC_CHECK, (int) &xyz, nxCoreCallback); // state
    return 0;