Skip to content

Quick Start Guide

Prerequisites

Development of your algo starts on your local machine. All necessary software will be privided via nanoconda-cli.

System Requirements:

  1. OS: RHEL-compatible system (Rocky Linux, CentOs, Red Hat Enterprice Linux).
  2. C/C++ Development libraries
  3. HugePages enabled
  4. Nanoconda License File is present.
  5. Nanoconda CLI archive is present.
  6. Market Data PCAP file(s) is present or there is connectivity to the Exchange

Note

If you don't have a license, a PCAP file, or have any other questions, please contact support@nanoconda.com

Docker environment

If your host operating system is different from Rocky or Red Hat, it is possible to run the software inside your Docker environment.

Tip

Refer to Docker Docs to install Docker Engine on your OS.

On Windows, enable WSL before installing Docker. Refer to Windows WSL Docs.

Below is the list of commands required to run a Docker container:

sudo docker pull rockylinux:9
sudo docker run -it --name rocky_env -p 2345:2345 --mount type=bind,source=/dev/hugepages,target=/dev/hugepages rockylinux:9 /bin/bash

Notes

  1. Port 2345 was mapped for future use by the GUI server. You may change it to any desired port.
  2. HugePages must be configured on the host machine and /dev/hugepages must be mounted to the container.

Preparing Your Dev Environment

The most common testing setup is for your algorithm to consume PCAP data and execute orders on a local simulator.

DataBento DBN files

Software can also consume DataBento DBN files in addition to PCAPs.

Please follow the steps below to set up your local environment:

1. Enable HugePages

Ensure HugePages are enabled and that your current user has write permissions to the /dev/hugepages directory

To check if HugePages are enabled:

grep Huge /proc/meminfo

Expected output:

HugePages_Total:     512
HugePages_Free:      512
Hugepagesize:       2048 kB

To enable HugePages and assign proper permissions:

echo 512 | sudo tee /proc/sys/vm/nr_hugepages
sudo chown -R user:user /dev/hugepages

To make this setting persistent across reboots: Add the following to /etc/sysctl.conf:

vm.nr_hugepages = 512

Then apply the configuration:

sudo sysctl -p

Warning

When running inside Docker, execute these steps on the host machine, not in the container

2. Nanoconda CLI Setup

  1. Extract the Nanoconda CLI archive to a known directory (e.g., /home/user/nanoconda/)
  2. Navigate to that directory and source the environment variables:

    cd /home/user/nanoconda/
    . env.sh
    

  3. Set the NANOCONDA_LICENSE environment variable to point to your license file:

    export NANOCONDA_LICENSE='/home/user/nanoconda_myCompany.lic'
    

  4. Ensure that the /var/nanoconda directory exists and is writable by the current user. It is required for trade log storage.

    mkdir /var/nanoconda
    

Warning

When running inside Docker, execute these steps from inside your container.

PCAP + Simulator

With the environment ready, let's launch your first application: a market data feed handler.

We'll use CME MDP3 for this example.

All required configuration XML files are located in the configs directory.

Ensure the pcap-file path in the XML is correct, then start the feed handler:

nanoconda-cli -a cmemdp3 -c config/CME-mdp3-prod-pcap-310-314-318-inc-only.xml

Next, start the simulator:

Make sure the GUI interface and port in config/simulator-session-xcme.xml are configured correctly:

Common setup for a public interface:

<Gui intf="eth0" port="2345"/>

Common setup for localhost:

<Gui intf="lo" port="2345" />

Then launch the simulator:

nanoconda-cli -a simulator -c config/simulator-session-xcme.xml

Note

To stop either application, press Ctrl+C

Your first application

The best way to learn the API is to dive in and run your own code.

We'll explore more API details later. For now, let's build and run your first app.

  1. Copy the following code (also available in src/firstApp.cpp) to create an application that sends a market order and prints the top level of the book.

  2. Compile it:

    g++ firstApp.cpp -lnanoconda -I nanocondaroot/include -L nanocondaroot/lib
    

  3. Run it:

    ./firstApp
    

Tip

Code is annotated. Click on the (1) icon in the guide to view additional information.

  1. You found on a sample annotation, now look for the same in the code below!
firstApp.cpp
/* Nanoconda 2025 | firstApp.cpp | g++ firstApp.cpp -lnanoconda 
* subscribe to ESM5 and submit one Market order 
*/
#include <cstdio>
#include "nanoconda.h"

using namespace nanoconda;
struct myListener : nanoconda::listener
{
   void onbook(const nanoconda::book* b) { 

      printf("myListener::onbook %s| [%u,%.4f | %.4f,%u] time: %llu\n", nanoconda::getSymbolName(b->symbolId), b->buys[0].qty, nacoPx(b->buys[0].price), nacoPx(b->sells[0].price), b->sells[0].qty, b->exchangetime);
   };
   void ontrade(const nanoconda::trade* t) { };
   void onorderack(const nanoconda::order* order) { };
   void onorderreject(const nanoconda::order* order) { };
   void oncancelack(const nanoconda::order* order) { };
   void oncancelreject(const nanoconda::order* order) { };
   void onmodifyack(const nanoconda::order* order) { };
   void onmodifyreject(const nanoconda::order* order) { };
   void onfill(const nanoconda::order* order) { };
   void onout(const nanoconda::order* order) { };
   void onorderstatus(const nanoconda::order* order) { };
   void onsecurity(const nanoconda::security* s) { };
};

int main(int argc, char *argv[])
{
   myListener* myApplication = new myListener();
   nanoconda::logger* mylogger = new nanoconda::logger("myLoggerFile.log");

   nanoconda::registerApplication("username1","password", myApplication); // (1) register your application
   nanoconda::subscribe("ESM5", "XCME"); //(2) subscribe to ESM5

   nanoconda::reasoncode rcode;
   nanoconda::dmasession* session = nanoconda::dmasession::init("useraccount1", rcode); // (3) create your order session

   if(rcode != nanoconda::SUCCESS)
   {
      fprintf(stderr, "DMA Session Initialization Failed with error %s\n",reasonToStr(rcode));
      return 1;
   }

   nanoconda::start();

   nanoconda::order myOrder; // (4) initialize a new order
   myOrder.setSymbol("ESM5");
   myOrder.quantity = 10;
   myOrder.type = MKT;
   myOrder.side = 'B';
   rcode = session->newOrder(&myOrder); // (5) submit a new order 
   if(rcode != nanoconda::SUCCESS)
   {
      fprintf(stderr, "New Order Failed with error %s\n",reasonToStr(rcode));
      return 1;
   }

   bool running = true;
   while(running) // (6) leave your main thread running 
   {
   }

   nanoconda::stop();

   return 0;
}
  1. Register your application with your listener and credentials, which are needed to identify your application. These are configured in XML files of Feed Handler and Simulator.
  2. Subscribe to ESM5 futures using the XCME entitlement code. Your credentials must be provisioned for this entitlement.
    Please read more on our Market Data API Page
  3. Create a new market access sesssion for "useraccount1". Account name must match from Simulator account-id value.
  4. Initialize a new order. See the Order Entry API for details.
  5. Submit your first MARKET order for ESM5 with a quantity of 10. More on this in the Order Entry API.
  6. Keep your main thread running to avoid premature termination. You can use your own logic to stop the loop, e.g., handling SIGINT to set running = false .

GUI Access to your session

To view your trading activity in real time, visit gui.nanoconda.com

Log in using your credentials, and enter the host and port (under the Advanced section) corresponding to your setup.

Note

The default username is user-trader and the default password is password. The host must match the IP of the interface used by the GUI - for example 127.0.0.1 if the GUI is running locally.

Login Window

Once logged in, you should see:

  • Account Summary showing 10 contracts long for ES
  • Trade Log containing your recent trade

First Trade

With your first application up and running—and real-time monitoring available through the GUI—you're now ready to explore more advanced capabilities.

Keep building, keep experimenting, and refer to the Software Reference for in-depth guidance on everything Nanoconda can do.