Appearance

Personalize your experience

Mode
Accent Color
Direction
Engines — Python vs C++

Engines — Python vs C++

Architecture

Two independent implementations of the same grid semantics, consuming the same config and the same command channel. The choice is a runtime choice, not a behavioural one.

One schema, two runtimes

Wizardapps/webNestJS APIgrid-botDragonflyconfig + commandsPython engineapps/gridC++ engineapps/hft/gridone snake_case config schema · both engines drain the same Redis command channel
The wizard writes one snake_case config; either engine can execute it.

Both engines read the identical strategy_parameters block, generate the same format, persist the same grid graph , and drain the same per- Redis command channel. That means the dashboard, the settings , the controls and the logs all work unchanged regardless of which one you pick — and a strategy can be moved between them.

Python engine (apps/grid)

  • Broadest broker coverage — the reference implementation, where new venues land first.
  • Arbitrary- Decimal — no - rounding considerations at all.
  • Easiest to introspect — rich structured logging, and the code for any behaviour is straightforward to read.
  • asyncio-based — one event loop per bot, fills processed on the loop.

For a normal grid — tens of levels, sub-second tolerance, a handful of strategies per account — this is the default.

C++ engine (apps/hft/grid)

  • - decimal — int64 scaled by 1e8, branch-free and -free on the fill .
  • Slot-per- threading — each is owned by exactly one worker , so fill processing, trailing and updates never race. Inbound are queued and applied by the owning thread.
  • Header-only engine core — inlining; the whole hot compiles into the binary.
  • Far lower per- cost — thousands of strategies per worker are practical.

Prefer it for tight spacing, deep ladders, high fill rates, or when running many strategies on one host.

ℹ
Note:The C++ engine also carries the orchestrator, so it can host the whole pool and serve the dashboard bridge itself.

Feature parity

Grid modes
The C++ is the canonical superset (27 modes) with rich per- . The Python enum carries the original nine; the modes are C++-first.
Live config update
Both apply size and target changes to already- in place, and both -and-replace on structural changes.
Grid extension
Both extend the ladder when the level count is raised, adding only the new rungs.
Trailing
Both implement -up sliding and trail-down , plus the idle-order deferral for marketable refills.
Stop loss
Implemented in the C++ engine as a dedicated guard evaluated on the engine ; the parameters -trip through the Python .
Reconciliation
Both run a missed-fill poller and a position auditor so a stall cannot silently desync the grid.
Session handling
Both detect -open transitions and rebuild the ladder, since venues between sessions.

Control plane

Lifecycle (pause, resume, stop, kill, rebalance, update_config) are published to a per- Redis channel plus a short-lived durable queue. Whichever engine owns the strategy drains it, so control is location-transparent: the dashboard does not need to know which worker or which runtime is hosting the bot.

★
Pro tip:Because the durable queue backs the pubsub channel, a command issued while a worker is briefly disconnected is still applied when it reconnects.

Choosing

Start here
Python — unless you have a specific reason not to.
Switch to C++ when
spacing is very tight, the ladder is deep, are frequent, or you are running many strategies per host.
Either way
The , the dashboard, the settings and the controls are identical.

Related

  • 1.Step 1 — Particulars — Where the engine is selected
  • 2.Strategy Lifecycle — Commands and live edits
  • 3.Step 3 — Preview & Deploy — What happens on deploy

Related articles

  • Predefined Strategies — Overview

    Automation / Predefined Strategies

    A predefined strategy is a fully-specified trading machine you configure once and deploy to a server-side engine. The grid strategy is the flagship: a…

  • Strategy Lifecycle

    Automation / Predefined Strategies

    What happens after deploy: which edits apply in place, which rebuild the ladder, how the lifecycle commands behave, and how a restart re-adopts a live grid.

  • Backtesting in Python and C++

    Backtesting / SDKs

    The quatick Python package and the header-only C++ library let you import indicators, backtest on your own machine and send the same file to Quatick.…

  • C++ SDK Reference

    Backtesting / SDKs / C++

    Header-only C++20 (packages/quatick-backtest-cpp): the position simulator, an event-driven engine with the same order rules as Python, analytics, a parallel…

  • Step 1 — Particulars

    Automation / Predefined Strategies / Wizard Steps

    Identity of the strategy: where it trades, what it trades, which way it leans, and which engine runs it. These fields are fixed once deployed.

  • Strategy DSL — The Engine

    Coding / Strategy DSL

    The native C++ engine (dslx) that parses, validates, backtests and runs strategy DSL: its modules, the catalog the editors are generated from, indicator…

  • The Backtest Engine

    Backtesting / Engine

    One service backtests every kind of strategy on Quatick. Each source type runs on the engine built for it, and every result is measured with the same…

  • Strategy Builder — Overview

    Automation / Strategy Builder

    A nine-step wizard for designing, testing and deploying automated trading strategies without writing code. Conditions are built from 100+ indicators,…

  • Capital Allocation

    Automation / Predefined Strategies / Risk & Capital

    The ceiling the strategy may deploy — and the one number people get wrong, because the ladder's cost depends on the grid mode, not on the level count.

Browse all knowledge base articles →