Zero-allocation hot path.
Pre-allocated indicator buffers and arena allocators eliminate GC pauses. Consistent latency across millions of bars, predictable to the nanosecond.
A high-performance C++23 backtesting engine with 138+ built-in indicators and vectorized execution. Zero heap allocations on the hot path: deterministic, reproducible, fast.
Compile once. Backtest forever.
1#include <stratforge/indicators.hpp> 2#include <stratforge/strategy.hpp> 3 4template<size_t N = 20> 5struct BollingerBreakout { 6 SMA<N> sma; // zero-alloc 7 StdDev<N> sd; 8 double k = 2.0; 9 10 constexpr auto on_bar(const Bar& b) 11 // std::expected<Signal, Err> — C++23 12 -> std::expected<Signal, Err> { 13 auto mu = sma.push(b.close); 14 auto sig = sd.push(b.close); 15 const auto upper = mu + k * sig; 16 const auto lower = mu - k * sig; 17 if (b.close > upper) return Signal::Long; 18 if (b.close < lower) return Signal::Short; 19 return Signal::Flat; 20 } 21};
Definitive v1.0 benchmark tables drop with release. Engineering numbers below are measured on current dev builds.
Built for fast, reproducible quantitative research with modern C++ best practices, with the discipline to leave nothing on the heap.
Pre-allocated indicator buffers and arena allocators eliminate GC pauses. Consistent latency across millions of bars, predictable to the nanosecond.
Header-only indicator library covering trend, momentum, volatility, volume, and statistical primitives. Composable templates, SIMD-friendly memory layout.
Dual MA, Bollinger Bands, MACD, Turtle, R-Breaker and more. Ship-shape implementations you can drop in, fork, or extend.
Bit-exact reproducibility across runs. No hidden randomness, no platform drift. Same input, same output, across compilers, across machines.
std::expected for error handling, std::span for zero-copy views, concepts for compile-time validation, consteval lookup tables. The hot path, written in the language it deserves.
Drop-in include path. No build-system gymnastics, no link-time surprises. Compose indicators and strategies with template-driven generic code.
Python backtesters are research-grade tools. StratForge is what you reach for when you need the same results an HFT shop would get.
| Python frameworks | StratForge · C++23 | |
|---|---|---|
| Memory model | GC pauses, allocator jitter, opaque internals | 0 heap allocs on hot path · arena + ring buffers |
| Indicator throughput | μs-per-bar · vectorize or wait | 3–14 ns per bar · incremental, branchless |
| Error handling | Exceptions, silent NaN, "is it None?" | std::expected · errors are values, not control flow |
| Reproducibility | Run-to-run drift from threads, dicts, libc | Bit-exact across compilers and OSes · SHA-equal output |
| Distribution | pip + 14 native deps + venv archaeology | Header-only · #include <stratforge.hpp> and compile |
Three stages, one event loop. Each stage owns its memory and never reaches back across the boundary.
Bar data is loaded into pre-allocated columnar buffers and indexed for O(1) access by timestamp or position. No surprise copies, just std::span everywhere.
Indicators compute incrementally per bar. Strategy logic evaluates entries and exits against indicator state through branchless decision paths.
Trades, equity curves, and performance metrics are streamed into pre-allocated report buffers and exported deterministically to Parquet, CSV, or your sink of choice.
Production-quality implementations of the classics. Drop one in, replace the parameters, ship.
Two threads to pull on next: the benchmark deep dive, or the live Q&A with the engine authors.
Full benchmark tables, optimization phases, and technique comparisons against Python backtesting frameworks. Hardware specs, methodology, raw numbers.
Explore the benchmarks →Expert-answered questions covering architecture, indicators, strategy patterns, and roadmap. Ask the engine, get an answer grounded in the source.
Open the chatbot →MIT licensed, header-only, and ready to drop into your existing C++ project. No build-system tax, no runtime dependencies. Just a header and a compiler that understands C++23.
StratForge is one of three engines in the StratCraft suite. Same philosophy: open-source where possible, performance-first, no lock-in.
Generate, manage, backtest, and deploy unlimited strategies with AI. Build your own trading system on your desktop. StratForge is the engine inside.
Learn more →C++23 FIX protocol engine. 3× faster than QuickFIX with zero-allocation design. Production-grade message handling for venues that don't forgive a missed heartbeat.
Learn more →