{"id":15047663,"url":"https://github.com/mccaffers/backtesting-engine-cpp","last_synced_at":"2025-05-15T17:30:45.281Z","repository":{"id":272893313,"uuid":"914523370","full_name":"mccaffers/backtesting-engine-cpp","owner":"mccaffers","description":"I'm developing a high-performance C++ backtesting engine designed to analyze financial data and evaluate multiple trading strategies at scale.","archived":false,"fork":false,"pushed_at":"2025-02-10T09:09:45.000Z","size":2791,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T12:11:15.279Z","etag":null,"topics":["backtesting","backtesting-engine","cpp","cpp20","trading"],"latest_commit_sha":null,"homepage":"https://mccaffers.com/building_a_cpp_backtesting_engine/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mccaffers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.MD","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-09T19:04:34.000Z","updated_at":"2025-02-08T19:28:30.000Z","dependencies_parsed_at":"2025-01-17T09:33:04.556Z","dependency_job_id":"cb820483-e34c-4ffc-9011-b72f18a55d65","html_url":"https://github.com/mccaffers/backtesting-engine-cpp","commit_stats":null,"previous_names":["mccaffers/backtesting-engine-cpp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mccaffers%2Fbacktesting-engine-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mccaffers%2Fbacktesting-engine-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mccaffers%2Fbacktesting-engine-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mccaffers%2Fbacktesting-engine-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mccaffers","download_url":"https://codeload.github.com/mccaffers/backtesting-engine-cpp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254388036,"owners_count":22062971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backtesting","backtesting-engine","cpp","cpp20","trading"],"created_at":"2024-09-24T21:02:39.644Z","updated_at":"2025-05-15T17:30:45.276Z","avatar_url":"https://github.com/mccaffers.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## C++ Backtesting Engine\n\nActive development!\n\nFeel free to explore, but this code base is usuable at the moment.\n\n### About The Project\n\nI'm developing a high-performance C++ backtesting engine designed to analyze financial data and evaluate multiple trading strategies at scale.\n\n[![Build](https://github.com/mccaffers/backtesting-engine-cpp/actions/workflows/sonarcloud.yml/badge.svg)](https://github.com/mccaffers/backtesting-engine-cpp/actions/workflows/sonarcloud.yml)  [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=mccaffers_backtesting-engine-cpp\u0026metric=bugs)](https://sonarcloud.io/summary/new_code?id=mccaffers_backtesting-engine-cpp) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=mccaffers_backtesting-engine-cpp\u0026metric=code_smells)](https://sonarcloud.io/summary/new_code?id=mccaffers_backtesting-engine-cpp) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=mccaffers_backtesting-engine-cpp\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=mccaffers_backtesting-engine-cpp)\n\nI'm extracting results and creating various graphs for trend analyses using SciPy for calculations and Plotly for visualization.\n\n![alt text](images/random-indices-sp500-variable.svg)\n\n*Read more results on https://mccaffers.com/randomly_trading/*\n\n## Setup\n\nThis backtesting engine can pull tick data from local files or from a Postgres database. I'm using QuestDB.\n\n### Postgres Setup - Requires libpq-dev or its equivalent for your OS:\n\n```\nFor Ubuntu/Debian systems: sudo apt-get install libpq-dev\nOn Red Hat Linux (RHEL) systems: yum install postgresql-devel\nFor Mac Homebrew: brew install postgresql\nFor OpenSuse: zypper in postgresql-devel\nFor ArchLinux: pacman -S postgresql-libs\n```\n\n### Postgres Setup (using C++20)\n\n```\ncd ./external/libpqxx\nmkdir -p build\ncd ./build\ncmake ..\n./configure CXXFLAGS=\"-std=c++20 -O3\"\nmake\n```\n\nXcode - Link Binary with Libraries (Source \u0026 Test)\n\n```\n./build/external/libpqxx/src/libpqxx-7.10.a\n```\n\nXcode - Headers Path (for libpqxx and nlohmann/json)\n\n``` \n\"$(SRCROOT)/external/libpqxx/include/pqxx/internal\"\n\"$(SRCROOT)/external/libpqxx/include/\"\n\"$(SRCROOT)/external/\"\n```\n\nXcode - Library Path\n\n```\n\"$(SRCROOT)/external/libpqxx/src\"\n\"$(SRCROOT)/build/external/libpqxx/src\"\n\"/opt/homebrew/Cellar/postgresql@14/14.15/lib/postgresql@14\"\n```\n\n### Test the build\n\n`sh ./scripts/build.sh`\n\n### Run via terminal\n\n`sh ./scripts/run.sh`\n\n### Run via test via terminal\n\n`sh ./scripts/test.sh`\n\n### License\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmccaffers%2Fbacktesting-engine-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmccaffers%2Fbacktesting-engine-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmccaffers%2Fbacktesting-engine-cpp/lists"}