Table of Contents


NxCoreClass

The class NxCoreClass is a helper class defined in NxCoreAPI_class.h to wrap the NxCoreAPI.dll and provide easy access to its functions. In many ways it is easier to use than the "C"-based approached shown in basics


#include "NxCoreAPI.h"
#include "NxCoreAPI_class.h"

NxCoreClass nxCoreClass;

int __stdcall nxCoreCallback(const NxCoreSystem* pNxCoreSys, const NxCoreMessage* pNxCoreMsg)
{
  printf("in nxCoreCallback\n");
  return NxCALLBACKRETURN_RETURN;
}

void startProcessing(const char* tape)
{
    if (!nxCoreClass.LoadNxCore("NxCoreAPI.dll") &&
        !nxCoreClass.LoadNxCore("C:\\Program Files\\Nanex\\NxCoreAPI\\NxCoreAPI.dll"))
    {
        fprintf(stderr, "Can't find NxCoreAPI.dll\n");
        exit(-1);
    }

    nxCoreClass.ProcessTape(tape, 0, NxCF_EXCLUDE_CRC_CHECK, 0, nxCoreCallback);
}

The class NxCoreClass is shown here in abbreviated format:

APIVersion

Get the API version


    #define cszNxCoreAPIVersion "sNxCoreAPIVersion"

    unsigned int APIVersion(
    );

ProcessTape

Starting point for Processing an NxCore Tape.


    #define cszNxCoreProcessTape "sNxCoreProcessTape"

    int ProcessTape(
        const char*                     pszFilename,
        const char*                     pMemoryAddr,
        unsigned int                    controlFlags,
        int                             UserData,
        NxCoreCallback                  callbackFunction
        );

ListTapes

Lists all available tapes on this computer


    #define cszNxCoreListTapes "sNxCoreListTapes"

    int ListTapes(
        unsigned int                    controlFlags,
        NxCoreCallbackTapeList          stdcallbacklist,
        void*                           pYourParam
        );

ListAPIDLLs

Lists all available NxCoreAPI.dll files on this computer


    #define cszNxCoreListAPIDLLs "sNxCoreListAPIDLLs"

    int ListAPIDLLs(
        unsigned int                    controlFlags,
        NxCoreCallbackAPIList           stdcallbacklist,
        void*                           pYourParam
        );

SpinSymbols

Starts a SymbolSpin which iteration each symbol for one or all List Exchanges.


    #define cszNxCoreSpinSymbols "sNxCoreSpinSymbols"

    int SpinSymbols(
        unsigned short                  ListedExg,
        unsigned int                    controlFlags,
        unsigned int                    spinID,
        NxCoreCallback                  tempCallback=0,
        int                             tempUserData=0
        );

SaveState

Creates a NxCore Tape "Bookmark" that NxCoreAPI can use as a starting point.


    #define cszNxCoreSaveState "sNxCoreSaveState"

    int SaveState(
        const char*                     szStateFilename,
        unsigned int                    controlFlags
        );

GetStateData


    #define cszNxCoreGetStateData "sNxCoreGetStateData"

    int GetStateData(
        char*                           pBuffer,
        int                             bufferSize,
        int                             stateType,
        int                             param1,
        int                             param2,
        NxString*                       pnxsSymOrCtc
        );

StateGetExgQuotes

Returns the current Memory State of a Symbol's Exchange Quotes.


    #define cszNxCoreStateGetExgQuotes "sNxCoreStateGetExgQuotes"

    int StateGetExgQuotes(
        NxCoreStateExgQuotes*           pStateExgQuotes,
        NxString*                       pnxsSymOrDateStrike=0
        );

StateGetMMQuotes

Returns the current Memory State of a Symbol's MM Quotes.


    #define cszNxCoreStateGetMMQuotes "sNxCoreStateGetMMQuotes"

    int StateGetMMQuotes(
        unsigned short                  ReportingExg,
        NxCoreStateMMQuotes*            pStateMMQuotes,
        NxString*                       pnxsSymOrDateStrike=0
        );

StateGetLastTrade

Returns the current Memory State of a Symbol's Open, High, Low, Last, Volume Data.


    #define cszNxCoreStateGetLastTrade "sNxCoreStateGetLastTrade"

    int StateGetLastTrade(
        NxCoreStateTrade*               pStateTrade,
        NxString*                       pnxsSymOrDateStrike=0
        );

PriceConvert

Converts an integer price from one price type to another.


    #define cszNxCorePriceConvert "sNxCorePriceConvert"

    int PriceConvert(
        int                             lPrice,
        unsigned char                   PriceType,
        unsigned char                   PriceTypeNew
        );

PriceFormat

Converts an integer price and price type into an Ascii string (like sprintf)


    #define cszNxCorePriceFormat "sNxCorePriceFormat"

    int PriceFormat(
        char*                           szBuff,
        int                             lPrice,
        unsigned char                   PriceType,
        int                             expandWidth=0,
        bool                            bCommas=false
        );

PriceToDouble

Converts an integer price and PriceType to a double floating value.


    #define cszNxCorePriceToDouble "sNxCorePriceToDouble"

    double PriceToDouble(
        int                             lPrice,
        unsigned char                   PriceType
        );

DateFromNDays

Computes the NxDate members from the NDays member.


    #define cszNxCoreDateFromNDays "sNxCoreDateFromNDays"

    void DateFromNDays(
        NxDate*                         pnxDate
        );

DateFromYMD

Computes the NxDate members from the Year, Month, Day members.


    #define cszNxCoreDateFromYMD "sNxCoreDateFromYMD"

    void DateFromYMD(
        NxDate*                         pnxDate
        );

GetDefinedString

Converts a string index into an pre-defined null-terminated ASCII string.


    #define cszNxCoreGetDefinedString "sNxCoreGetDefinedString"

    const char* GetDefinedString(
        int                             ixTable,
        int                             ixString
        );

GetTapeName

Returns the full path filename of the NxCore Tape being processed.


    #define cszNxCoreGetTapeName "sNxCoreGetTapeName"

    int GetTapeName(
        char*                           szBuffTapename,
        int                             nBufferBytes
        );

SignalWaitEvent


    #define cszNxCoreSignalWaitEvent "sNxCoreSignalWaitEvent"

    int SignalWaitEvent(
        const NxCoreSystem*             pNxCoreSystem,
        bool                            bAlwaysSignal
        );

Callback Functions

NxCoreCallback


    typedef int (__stdcall *NxCoreCallback) (const NxCoreSystem* pNxCoreSys, const NxCoreMessage* pNxCoreMsg);

NxCoreCallbackTapeList


    typedef int (__stdcall *NxCoreCallbackTapeList) (void* pYourParam, const NxCoreTapeFile* pNcTF);

NxCoreCallbackAPIList


    typedef int (__stdcall *NxCoreCallbackAPIList) (void* pYourParam, const NxCoreAPIDLLFile* pNcTF);