Active development!
Feel free to explore, but this code base is usuable at the moment.
I'm developing a high-performance C++ backtesting engine designed to analyze financial data and evaluate multiple trading strategies at scale.
I'm extracting results and creating various graphs for trend analyses using SciPy for calculations and Plotly for visualization.
Read more results on https://mccaffers.com/randomly_trading/
This backtesting engine can pull tick data from local files or from a Postgres database. I'm using QuestDB.
The project depends on two vendored libraries (libpqxx and boost-decimal) tracked as git submodules under external/. If you didn't clone with --recurse-submodules, run:
git submodule update --init --recursive
scripts/build_dep.sh does this for you on first run.
For Ubuntu/Debian systems: sudo apt-get install libpq-dev
On Red Hat Linux (RHEL) systems: yum install postgresql-devel
For Mac Homebrew: brew install postgresql
For OpenSuse: zypper in postgresql-devel
For ArchLinux: pacman -S postgresql-libs
libpqxx is built once via CMake. boost-decimal is header-only and pulled in via add_subdirectory from the top-level CMakeLists.txt — nothing to build. The script below handles the libpqxx build:
bash ./scripts/build_dep.sh
Xcode - Link Binary with Libraries (Source & Test)
./build/external/libpqxx/src/libpqxx-7.10.a
Xcode - Headers Path (for libpqxx and nlohmann/json)
"$(SRCROOT)/external/libpqxx/include/pqxx/internal"
"$(SRCROOT)/external/libpqxx/include/"
"$(SRCROOT)/external/"
Xcode - Library Path
"$(SRCROOT)/external/libpqxx/src"
"$(SRCROOT)/build/external/libpqxx/src"
"/opt/homebrew/Cellar/postgresql@14/14.15/lib/postgresql@14"
bash ./scripts/build.sh
bash ./scripts/run.sh
bash ./scripts/test.sh
This is an active solo experiment, so I'm not accepting pull requests right now — but please fork freely and use GitHub Issues for bugs, questions, and ideas. See CONTRIBUTING.md for details.