NxCore API Language Wrappers and Sample Apps

If you're new to NxCore then this is the place to start. The Language Wrapper/Sample Apps are 10 extremely simply applications, each taking you through one or two key NxCore concepts.


The current languages supported include:
  • C
    All samples written in a straight "C" fashion: bare bones NxCore functionality at it's finest.

  • C++
    Very similar to the C language samples with the exception of the NxCore functions are wrapped into a class and called as such. The examples are nearly identical to those in the C language samples.

  • C#
    A Language wrapper(s) file for 32 and 64 bit C-Sharp development. All samples written in C#.

Each of the 10 sample apps is duplicated for either C/C++/C# and each supported language is included in a separate file folder for easy separation. Each sample application looks as close to the same sample in another language as is possible. Each also follows the conventions of the NxCore C/C++ (its native language) API as closely as possible.

What the Samples Demonstrate:

Each example will take you through one or two specific concepts in NxCore. The entire NxCore API library is utilized within all ten examples. The specific concept explored in each sample are as follows:

  1. SampleApp1
    Starting NxCore ProcessTape.
    Defining/using NxCore Callback function.
    Handling the NxCore Status message.

  2. SampleApp2
    Handling the NxCore Symbol Spin Message.
    Using NxOptionHdr.
    Constructing Option Symbols in OSI or old OPRA format.

  3. SampleApp3
    Handling the NxCore Category Message.

  4. SampleApp4
    Handling NxCore Trade messages.
    Handling Exg Quote messages.
    Handling MMQuote messages.

  5. SampleApp5
    Starting ProcessTape from a thread.

  6. SampleApp6
    Retrieving StateTrades.
    Retrieving StateExgQuotes.
    Retrieving StateMMQuotes.

  7. SampleApp7
    User defined symbol spin function.
    Available NxCore Data file listings.
    Available NxCore DLL file listings.
    Retrieving strings from NxCore Tables.
    Get Date from N days.
    Get N days from date.

  8. SampleApp8
    User defined symbol spin function.
    Setting UserData1 and UserData2 values.
    Retrieving UserData1 and UserData2 values.
    Constructing Option Symbols in OSI or old OPRA format.

  9. SampleApp9
    Sending User Defined Data through the ProcessTape function, retrieving it in the NxCore Callback.

  10. SampleApp10
    Saving to a NxCore State Tape
    Running from an NxCore State Tape.

The Console Window:

Each Sample runs as a Windows Console application. By sticking with the console applications the various complexities of the specific GUI implementation are removed allowing the developer to stick with learning the concepts of NxCore as quickly as possible. Output on the console applications can be extremely fast for human viewing. If you wish to examine data in detail simply grab the console's vertical scroll bar button with the mouse and hold it. The thread will pause from processing allowing you to examine the data output in detail. To continue processing simply release the scroll bar button.

Output from SampleApp3:


In many of the applications, each and every trade and/or quote and/or category message is displayed by constructing a string with the data and outputting it to the console. In some cases this is done for every symbol in the system. Printing to the console in this fashion is slow, and printing every single message can slow performance considerably (it is certainly not something you would want to do in a real world application). However, the goal of these applications is to get you working with NxCore structures and functions as quickly as possible, not to demonstrate our programming prowess or have you wade through mountains of GUI code to understand what is happening.

C and C++ offer the highest performance available. By their very nature, managed languages such as C# will offer less raw performance. If speed is what you demand we highly recommend using the C or C++ libraries and applications.

Running the projects within Visual Studio:

The console apps expect a NxCore filename to be passed in as the only argument. If you try running the application from the project folder, it will not find the NxCore DLL files required. These are placed one directory up in the language main folder.

To set both of the properties so that you may run inside the Visual Studio environment go to the project settings and set 'Command Arguments' and 'Working Directory':

Make sure the filename and working directory are specific to your environment; the above is just a sample.