Chronos is a high performance backtesting architecture designed for quantitative researchers. It processes level one tick data with zero dynamic memory allocation to simulate trading strategies with absolute fidelity. The project demonstrates advanced systems programming applied to market microstructure constraints like latency, slippage and spread crossing.
The engine operates on a strict one way data flow via a central event bus. The core execution handler is written in C++20 to achieve maximum throughput. Standard queues allocate memory dynamically when items are pushed but Chronos utilizes a single producer single consumer ring buffer. This preallocates a fixed block of memory on startup to ensure constant time operations and zero garbage collection spikes.
Data ingestion bypasses standard file reading methods. The engine uses direct memory mapping to load binary structs directly into virtual memory. This allows the system to process massive datasets while utilizing minimal active RAM.
The analytics interface is built with Python and pybind11. This design choice provides quantitative developers the raw speed of a native binary along with the flexible data visualization power of Pandas.
- Zero allocation execution hot path
- Lock free concurrency model
- Memory mapped file ingestion for massive tick datasets
- Strict determinism ensuring identical profit generation across multiple runs
- CMake build system
- GCC compiler supporting C++20
- Python version 3.10 or newer
- pybind11, Pandas and NumPy
Create a build directory inside the project root. Run the CMake configuration command followed by the make command to compile the native C++ tools and the shared Python module.
mkdir build
cd build
cmake ..
makeFirst you must prepare your data environment. Execute the mock data generator script to create millions of raw market ticks.
cd tools
python generate_mock_data.pyNext you will use the compiled C++ binary tool to pack this text data into the specialized memory mapped format.
cd ../build
./csv_to_bin ../data/raw_ticks.csv ../data/market_data.binFinally you can run the main Python analytics script. This will initialize the C++ core, process the binary data and return the execution ledger to Python for Sharpe ratio calculations and equity curve plotting.
cd ../python
export PYTHONPATH=../build:$PYTHONPATH
python run_backtest.py