Technology Stack

🧬 Core Language
C++23 CMake 3.31+
πŸ“¦ Libraries
Boost.JSON Eigen (ML) WebSocket REST APIs
⚑ Performance Engine
Lock-Free Queues Low-Latency Events Memory Pools Custom Decimal Multi-Threaded
πŸ–₯️ Hardware Acceleration
SIMD / AVX CUDA / OpenCL GPU Acceleration
πŸš€ Deployment
DLL Plugins MSVC / GCC / Clang Windows & Linux

System Architecture

ttTrader is built around a modular, event-driven architecture. Each component communicates through a central event dispatcher using lock-free queues β€” enabling true parallelism without synchronization overhead. Run multiple algos simultaneously, each watching instruments from different exchanges at the same time. Process market data from Binance to generate execution signals on Bitfinex, or arbitrage across Bybit and OKX β€” the unified event pipeline makes cross-exchange strategies as natural as single-exchange ones.

Binance
Bybit
OKX
Kraken
Hyperliquid
+8 more
β–Ό   β–Ό   β–Ό   β–Ό   β–Ό   β–Ό
Exchange Manager
Market Data Mgr
Order ManagerLive / Sim
WebSocket ServerFrontend API
β–Ό   β–Ό   β–Ό   β–Ό
⚑ Event Dispatcher Lock-Free · Multi-Producer · Multi-Consumer
β–Ό       β–Ό       β–Ό       β–Ό
IndicatorsEMA Β· MACD Β· RSI
Bollinger Β· ATR Β· 6+ more
Algo #1DLL Plugin
Algo #2DLL Plugin
PlaybackRecord / Replay
Each algo compiles independently and comes in a separate shared library

Market Data Pipeline

Every tick, every order book update, every trade β€” captured, normalized, and delivered to your strategy through a zero-copy, lock-free pipeline.

πŸ”„

Trades (Tick Data)

Every trade: price, size, timestamp, and taker direction (buy/sell aggressor). Cumulative Volume Delta (CVD) is tracked on every tick for volume-pressure analysis. Circular buffer stores 16,384 most recent trades.

πŸ“–

Best Bid & Offer

Real-time BBO with price, size, spread tracking, and microsecond timestamps. 16,384-entry circular buffer for short-term microstructure analysis. Spread history maintained for real-time spread percentile calculations.

πŸ“š

Order Book (L2)

Full depth-of-book: up to 20 price levels per side in live trading, 5 levels during playback. Each level carries price + aggregated size. Book pressure and imbalance metrics computable at every update.

Algorithm Development

Strategies are implemented as independent DLL plugins. Derive from algoFramework_c, override the callbacks you need, and compile. No boilerplate, no ceremony.

Override What You Need

β†’
onMarketdataTick()
Every trade with price, size, CVD, taker direction
β†’
onMarketdataBbo()
Best bid/ask with integrated spread tracking
β†’
onMarketdataBook()
Full order book snapshot β€” 20 levels per side
β†’
onMarketdataOhlcClose()
OHLC bar completion with configurable timeframes
β†’
onOrderFill()
Execution confirmation with price, size, fee breakdown
β†’
onTimer()
Periodic callbacks for heartbeat, polling, or scheduled logic
// Your strategy β€” minimal boilerplate class MyAlgo : protected algoFramework_c { protected: void onMarketdataTick( instrumentInfo_s* instr, singleTradeInfo_s* trade ) override { // CVD divergence check if (detectDivergence(instr)) { m_orderManager.orderCreateLimit( instr, EOID_BUY_OPEN_LONG, size, limit, userId, "CVD entry" ); } } };

Order & Risk Management

πŸ“

Order Types

Type Description
Market Execute immediately at best available price
Limit Resting order at specified price level
Stop-Market Trigger β†’ market execution
Stop-Limit Trigger β†’ limit order placement

TIF: GTC, FOK, IOC, GTD β€” all supported.

πŸ›‘οΈ

Risk Controls

Method Usage
Fixed Risk Absolute USD risk per trade
Percent / BPS Risk as % of account or basis points
Min Size Γ— Multiplier Scaled to instrument liquidity
Stop-Loss Engine OHLC-based, indicator-based, or ATR-multiplier stops

Pyramiding: Multiple concurrent positions per instrument with independent risk tracking.

Indicators & Machine Learning

Built-in technical indicators plus the ability to integrate custom ML models.

πŸ“

Built-in Indicators

βœ“
SMA, EMA, WMA, HMA, ZLHMA
βœ“
MACD (with histogram)
βœ“
RSI (Relative Strength Index)
βœ“
Bollinger Bands (configurable Οƒ)
βœ“
ATR β€” Average True Range
βœ“
Average Bar Range
βœ“
Trading Range (High/Low)

All indicators accept OHLC data from any timeframe. Add custom indicators by implementing the indicatorCore interface.

🧠

ML & Advanced Analytics

β†’
Eigen Integration
Linear algebra, PCA, regression, Kalman filters for signal processing and regime detection β€” all header-only, zero runtime dependency.
β†’
Online Learning
Strategies can use online gradient descent or recursive least squares to adapt parameters in real-time based on PnL feedback.
β†’
Local LLM Integration
Connect to local LLM inference (llama.cpp) via IPC for regime classification and meta-decision making β€” no cloud dependency.
β†’
Neural Networks
Implement simple feed-forward NNs using Eigen matrices for pattern recognition on market microstructure features.
⚑

GPU Acceleration β€” CUDA & OpenCL

β†’
Deep Neural Networks
Train and run inference on large-scale NNs directly on GPU hardware for real-time market microstructure analysis.
β†’
Monte Carlo Simulations
Parallelize thousands of simulation paths for options pricing, risk analysis, and strategy stress-testing.
β†’
Portfolio Optimization
Solve large-scale portfolio allocation problems with GPU-accelerated linear algebra β€” orders-of-magnitude faster than CPU.
β†’
Real-Time Signal Processing
Offload compute-intensive signal transforms and filtering to GPU β€” keep your CPU free for order execution and event handling.

Integrate CUDA or OpenCL kernels directly into your algo DLL. No separate infrastructure needed β€” the framework handles data transfer and kernel launch.

Playback & Backtesting

Record live market data, then replay it through the exact same event pipeline your strategy uses in production. No separate backtesting framework β€” no discrepancies.

Binary Recording Format (.ttpb v2)

Compact, efficient binary format stores trades, BBO, and order book snapshots (up to 5 levels).

Replay at original speed, accelerated, or stepped β€” full control over the simulation timeline. The built-in simulation engine fills orders against recorded BBO with configurable fee models, matching each exchange's actual maker/taker fee schedule.

Live Market β†’ [.ttpb Record] β†’ Disk

Disk β†’ [Playback Engine] β†’ Same Event Pipeline
                         β†’ Your Algo (unchanged)
                         β†’ Sim Engine fills orders

Exchange Integration

Each exchange implements a standardized protocol interface. Adding a new exchange means implementing exchangeProtocol.h β€” the rest of the framework doesn't change.

Exchange Data Execution Fee Note
Binance Trades, BBO, Book Market, Limit Standard maker/taker
Bybit Trades, BBO, Book Market, Limit Standard maker/taker
OKX Trades, BBO, Book Market, Limit Standard maker/taker
Bitfinex Trades, BBO, Book Market, Limit Standard maker/taker
Poloniex Trades, BBO, Book Market, Limit Standard maker/taker
Kraken Trades, BBO, Book Market, Limit Standard maker/taker
Bitstamp Trades, BBO, Book Market, Limit Standard maker/taker
Bitget Trades, BBO, Book Market, Limit Standard maker/taker
Hyperliquid Trades, BBO, Book Market, Limit Standard maker/taker
Paradex Trades, BBO, Book Market, Limit Standard maker/taker
Aster Trades, BBO, Book Market, Limit Standard maker/taker
Lighter Trades, BBO, Book Market, Limit Standard maker/taker
Phemex Trades, BBO, Book Market, Limit Standard maker/taker
Interactive Brokers Trades, BBO, Book Market, Limit Standard maker/taker

All exchanges provide futures/perpetual instruments. Spot, inverse, and vanilla futures supported where available.

Deployment Flexibility

πŸ–₯️

Local System

Run on your development machine or dedicated trading server. Full Windows and Linux support. Low barrier to entry for strategy development and testing.

☁️

AWS / Cloud

Deploy on EC2 instances in regions close to exchange data centers. Auto-scaling not needed β€” a single well-provisioned instance handles all strategies.

πŸ“

Collocated

For latency-sensitive strategies: deploy on bare metal in exchange colocation facilities. The lock-free architecture ensures predictable, minimum latency.