8000 GitHub - SlickQuant/slick-trader: Multi-broker algorithmic trading engine in C++23: lock-free messaging, hot-loadable strategy plugins, FIFO position/PnL and pre-trade risk, futures and multi-leg accounting, positions that survive restarts, and a live web dashboard. · GitHub
[go: up one dir, main page]

Skip to content

About

Multi-broker algorithmic trading engine in C++23: lock-free messaging, hot-loadable strategy plugins, FIFO position/PnL and pre-trade risk, futures and multi-leg accounting, positions that survive restarts, and a live web dashboard.

Topics

Resources

Stars

3 stars

Watchers

2 watching

Forks

Repository files navigation

SlickTrader

C++23 License: MIT CI Sanitizers GitHub release

A multi-broker algorithmic trading engine written in modern C++23. SlickTrader connects to exchanges over WebSocket/REST, routes market data and order events through a lock-free messaging core, runs trading strategies as plugins, and serves a real-time web dashboard for monitoring and manual trading.

Status: 0.11.0. The Coinbase and Hyperliquid brokers are built in, and more can be built in from their own repositories. Order execution needs broker credentials. The sample config is production ("environment": "Production"): Coinbase market data and orders go to the real exchange. See Known gaps before you rely on any of this.

Features

  • Multi-broker: Coinbase Advanced Trade and Hyperliquid today. Market data and order execution are separate per-broker connectors behind the IBroker interface.
  • Lock-free messaging core: connectors, the strategy manager and the web server exchange events through slick-queue and a stream_buffer_multiplexer.
  • Strategy plugins: strategies are shared libraries (.dll, .so, .dylib) loaded when the engine starts, so no engine rebuild is needed to change strategy logic. Parameters can be changed live from the dashboard. Replacing a plugin binary needs a restart.
  • Positions, PnL and risk: FIFO lots, realized and unrealized PnL, futures multipliers and pre-trade limits (position, order value, order rate, max loss). Positions can survive a restart.
  • Market-by-order books and queue position for brokers whose feed carries every order.
  • Live web dashboard: a Preact frontend with no build step, served over uWebSockets with a REST API. A click-to-trade ladder and other tools open in popup windows that save as named workspaces.
  • Manual and automated trading side by side: a built-in ManualStrategy owns orders placed from the dashboard, under the same risk and position tracking as plugin strategies.

Quick start

Requirements: a C++23 compiler (MSVC 2022, GCC 14 or Apple clang from Xcode 16), CMake 3.28 or newer, and vcpkg for uWebSockets, nlohmann_json and GTest. Everything else is found as an installed package or fetched. See Building for options and details.

cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=<vcpkg-root>/scripts/buildsystems/vcpkg.cmake
cmake --build build --config Debug --parallel
ctest --test-dir build -C Debug --output-on-failure

Copy config/config_example.json to config/config.json (gitignored) and edit it, then run the engine with the config path as its only argument:

build/src/Debug/slick-trader config/config.json

Open http://localhost:<web_server_port> for the dashboard and stop the engine with Ctrl+C. Each release also ships a ready-to-run package for Windows, Linux and macOS.

The example trades on real Coinbase. To try it against a simulator first, see Simulator and slick-sim.

Documentation

Full documentation is published at https://slickquant.github.io/slick-trader/:

The sources live in docs/ and render on GitHub too.

Building the documentation locally

# narrative docs, live preview on http://127.0.0.1:8000
pip install -r requirements-docs.txt
mkdocs serve

# API reference (needs doxygen and graphviz on PATH), output in doxygen-out/html
cmake -S . -B build
cmake --build build --target docs

The docs target only appears when find_package(Doxygen) succeeds. A normal build is unaffected without Doxygen.

Project layout

include/slick-trader/   Public headers (.hpp): core, brokers, strategy, events, market_data, web, utils
src/                    Implementation, each broker under src/brokers/<name>/, plus main.cpp
cmake/                  Build helpers such as slick_trader_add_broker()
strategies/             Strategy plugins built as shared libraries, with example configs
tests/                  GoogleTest suite and fixtures
web/static/             Dashboard frontend (HTML, CSS, JS)
config/                 Runtime configs (only config_example.json is checked in)
docs/                   MkDocs sources for the documentation site

Conventions

  • Headers use the .hpp extension.
  • Shared state is single-writer and lock-free by design where it can be. See Architecture for where it is not.
  • Bug fixes come with a regression test.

License

MIT, see LICENSE.

About

Multi-broker algorithmic trading engine in C++23: lock-free messaging, hot-loadable strategy plugins, FIFO position/PnL and pre-trade risk, futures and multi-leg accounting, positions that survive restarts, and a live web dashboard.

Topics

Resources

Stars

3 stars

Watchers

2 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages

0