For Reamer Research, Python or C++: a pip-installable package and a one-header C++20 wrapper ship in the kit. Underneath is a stable C ABI, so any other language that can call C can wrap it, live trading included. For Reamer Server, the gate and the broker connector are written in C, C++, Rust or Go, and strategies connect over a socket from any language, Python included.
The Python package and the C++ header are how most people use Reamer Research, and release CI tests both. They sit on a stable, versioned C ABI, which is also open to you directly: backtests, results and the live relay are all calls in that interface. The Python and C++ code ships in source, so you can read it or adapt it.
Reamer Research
- Python. A package you
pip install, with the engine inside it, for Python 3.9 or later and numpy, with nothing to compile.rr.backtest(on_bar, "AAPL.csv")runs a strategy over CSV,.bin, pandas or numpy bars. Youron_barfunction sees each instrument's recent bars as numpy arrays, its positions and resting orders, and returns orders and order actions. Templates and example strategies are included. - C++. One C++20 header, found by CMake or pkg-config:
rr::backtest(on_bar, "AAPL.csv")with a lambda or an object strategy, and orders with brackets chained on. Example strategies are included. - Any other language, such as Rust, Go, Julia or C#, by wrapping the C ABI. Nothing is lost: backtesting, the JSON result and the live relay (
reamer_relay_*) are all in the interface, so your own wrapper trades live too. The Python and C++ code shows how a wrapper is built.
Two things to know about Python:
- It is fast, and C++ is faster. In a published benchmark of release 4.6.0, 500,000 bars took 3.38 s from Python and 0.36 s from C++, against 13.61 to 76.85 s for NautilusTrader and 15.04 s for Backtrader. See How fast is it?
- It covers what a backtest needs. Per-instrument costs, non-price data such as earnings dates, memory-mapped
.binfiles and the live relay are all reachable from Python, as they are from C++.
See Is there a backtesting engine I can call from Python that runs locally and never uploads my code?
Reamer Server
- The gate and the connector are compiled into your server program, which links the core library. The kit has starting points in C++ and Rust (an accept-all gate with a paper broker) and a worked integration in Go, including a FIX 4.4 session.
- Strategies are separate processes, so they can be in any language. They connect over a local Unix socket, with a byte-for-byte specified protocol, or through a relay. The kit's reference relay accepts one JSON message per line over TCP, so a Python strategy needs only the standard library. See How do I run several strategies through one broker connection?
A strategy researched in Python can stay in Python when it goes live; the change is from a backtest loop to a live event loop. See How do I take a strategy from backtest to live trading without a rewrite?