rburkholder/trade-frame

C++ 17 based library (with sample applications) for testing equities, futures, currencies, etfs & options based automated trading ideas using DTN IQFeed real time data feed and Interactive Brokers (IB TWS API) for trade execution. libtorch/lstm/cuda demo. Support for Alpaca & Phemex. Notifications via Telegram.

trade‑frame – C++ framework for high‑speed market‑data, analytics and order execution

What it is
A collection of C++17 libraries and example applications for building low‑latency, high‑capacity trading systems. The core focuses on:

  • ingesting market data (IQFeed, Interactive Brokers, Alpaca, Phemex),
  • organising time‑series data, computing indicators and option Greeks in real time,
  • simulating order flow with configurable latency/slippage, and
  • managing orders, positions, portfolios and option‑combo life‑cycles.

Key components

Library Purpose
TFTimeSeries Stores quotes, trades, Greeks, Level‑II order‑book data
TFOptions Option objects with a real‑time Greek engine
TFTrading Order, execution, position and portfolio management
TFSimulation Offline back‑testing engine that replays captured market data with a 50‑100 ms delay queue
TFIQFeed / TFInteractiveBrokers Connectors to market‑data and brokerage APIs
TFIndicators Common technical‑analysis indicators
TFHDF5TimeSeries Persists time‑series to HDF5 files
TFVuTrading UI widgets (wxWidgets) for visualising data and orders
OUCharting ChartDirector wrapper for plotting
OUSQL SQLite ORM for trade‑record storage

Example applications

  • AutoTrade – template for an automated HFT strategy (includes early ML work).
  • ComboTrading – demonstrates tracking multi‑leg option combos through their full life‑cycle.
  • Collector – streams live bid/ask ticks to disk for later back‑testing or model training.
  • LiveChart, DepthOfMarket, IndicatorTrading, SP500 (LSTM‑based prediction using libtorch), etc.

How to get started

  1. Install dependencies (Debian‑based: git, wine64, wxWidgets, boost, curl, zlib, hdf5, sqlite, portaudio19-dev, libcrypto++-dev).
  2. Clone the helper repo libs-build and run ./build.sh tradeframe to fetch and compile the required third‑party libraries.
  3. Clone this repository, create a build directory, run cmake .. and cmake --build . (Debug or Release).
  4. Start the IQFeed daemon (via Wine) and Interactive Brokers TWS in paper‑trading mode, then run one of the sample apps (e.g., IQFeedMarketSymbols, ComboTrading).

Who it’s for
Quant developers or hobbyist algorithmic traders who need a C++ foundation for low‑latency market‑data handling, option‑combo accounting, and simulation. The code is production‑oriented (uses -march=native, supports Level‑II data, includes a portfolio‑level P/L tracker) but requires substantial setup effort and familiarity with C++ build tools.

Scope
The project is squarely in the domain of algorithmic trading infrastructure rather than AI research. It does contain a small ML example (LSTM on collected data) but the primary focus is on market‑data ingestion, real‑time analytics, and order execution.

Related

  • Project
  • Project
  • Project
  • Project
  • Project