A comprehensive look at the architecture, design decisions, and capabilities that make ttTrader a production-grade trading framework.
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.
Every tick, every order book update, every trade — captured, normalized, and delivered to your strategy through a zero-copy, lock-free pipeline.
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.
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.
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.
Strategies are implemented as independent DLL plugins. Derive from algoFramework_c,
override the callbacks you need, and compile. No boilerplate, no ceremony.
| 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.
| 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.
Built-in technical indicators plus the ability to integrate custom ML models.
All indicators accept OHLC data from any timeframe. Add custom indicators
by implementing the indicatorCore interface.
Record live market data, then replay it through the exact same event pipeline your strategy uses in production. No separate backtesting framework — no discrepancies.
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.
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.
Run on your development machine or dedicated trading server. Full Windows and Linux support. Low barrier to entry for strategy development and testing.
Deploy on EC2 instances in regions close to exchange data centers. Auto-scaling not needed — a single well-provisioned instance handles all strategies.
For latency-sensitive strategies: deploy on bare metal in exchange colocation facilities. The lock-free architecture ensures predictable, minimum latency.