CppTrader Documentation

repository·master·Indexed 21 days ago

https://github.com/chronoxor/cpptrader

A high-performance C++ library for trading platforms featuring a matching engine, order book processor, and NASDAQ ITCH message handlers. It includes multiple Market Manager versions, ranging from standard to aggressively optimized for low latency and high throughput.

Tokens
524
Snippets
3
Records
5
Agent score
27%

What's inside CppTrader

  1. Overview of CppTrader components

    master

    CppTrader is a set of high-performance C++ components designed for building trading platforms. Its core components include:

    • Ultra fast matching engine: For processing trade orders.
    • Order book processor: For managing and maintaining order books.
    • NASDAQ ITCH handler: For parsing and handling ITCH messages from input streams.
  2. Performance characteristics of Market Manager versions

    master

    CppTrader provides different versions of the Market manager depending on the required balance between features and raw performance:

    1. Standard Market Manager: Handles order operations (add, reduce, modify, delete, execute) and builds order books.
    2. Optimized Market Manager: Uses pre-allocated arrays for symbols, order books, and orders (O(1) operations). It uses sorted arrays for price levels instead of Red-Black trees to improve CPU cache locality.
    3. Aggressive Optimized Market Manager: Achieves near-optimal latency and throughput by removing features like symbol maintenance, using signed 32-bit integers for price values, and removing the market handler (no notifications).
  3. Setup and build CppTrader repository

    master

    To set up the repository and prepare it for building, clone the repository, enter the directory, and use gil update to fetch dependencies. After setup, use the platform-specific build script located in the build directory.

    General Setup

    git clone https://github.com/chronoxor/CppTrader.git
    cd CppTrader
    gil update

    Build Commands by Platform

    Linux & MacOS

    cd build
    ./unix.sh

    Windows (Cygwin or MSYS2)

    cd build
    nix.bat

    Windows (MinGW)

    cd build
    mingw.bat

    Windows (Visual Studio)

    cd build
    vs.bat