Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ jobs:
fetch-depth: 0
- name: Install dependencies
run: sudo apt install -y libssl-dev libpq-dev libcurl4-openssl-dev
# ubuntu-latest (24.04) defaults to GCC 13, whose libstdc++ lacks the
# C++23 <print> header (std::print/std::println). That header was added
# in GCC 14, so install it and make it the default compiler for every
# subsequent step (dependency build, CMake configure, build-wrapper).
- name: Install GCC 14 (for C++23 <print>)
run: |
sudo apt install -y gcc-14 g++-14
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
# Ubuntu's apt Boost (1.83 on 24.04) predates Boost.Redis, which was added
# in Boost 1.84, so <boost/redis.hpp> is absent. Install a newer Boost.
# Boost.Redis/Asio are header-only, so we only need the headers plus the
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ xcuserdata/
xcuserstate/
TestResult.xcresult/
sonarqube-generic-coverage.xml
external/libpqxx
.cache/clangd/
.clangd
dump.rdb
.infisical.json
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ execute_process(
project(BacktestingEngine)

# Set the C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Configure libpqxx build
Expand Down Expand Up @@ -40,6 +40,7 @@ include_directories(
${CMAKE_SOURCE_DIR}/include/commands
${CMAKE_SOURCE_DIR}/include/utilities
${CMAKE_SOURCE_DIR}/include/models
${CMAKE_SOURCE_DIR}/include/reporting
${CMAKE_SOURCE_DIR}/include/trading
${CMAKE_SOURCE_DIR}/include/trading_definitions
${CMAKE_SOURCE_DIR}/include/strategies
Expand All @@ -64,9 +65,9 @@ if(APPLE)
endif()

# Boost (Homebrew) — Boost.Redis is header-only but its implementation is
# compiled into one TU via <boost/redis/src.hpp> (included in
# source/redisRunner.cpp). It pulls in Boost.Asio's SSL layer, which needs
# OpenSSL.
# compiled into one dedicated TU via <boost/redis/src.hpp> (source/
# boostRedisImpl.cpp), which isolates its macro/SSL pollution from the rest of
# the build. It pulls in Boost.Asio's SSL layer, which needs OpenSSL.
find_package(Boost REQUIRED CONFIG)
find_package(OpenSSL REQUIRED)
find_package(Threads REQUIRED)
Expand Down
9 changes: 3 additions & 6 deletions CONVENTIONS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
### Headers folder (./source/include)
Header files are saved within ./source/include
Header-only headers in include/ are globally available and source/*.cpp is globbed automatically.

### Pragma once
Headers should use `#pragma once` directive. It's non-standard but widely supported preprocessor directive in C and C++. It's used as an include guard to prevent multiple inclusions of the same header file.
Headers should use `#pragma once` directive to guard to prevent multiple inclusions of the same header file.

### Lower Camel Case file names
application.cpp / class Application()

* Often preferred in Unix-like environments and by many open-source projects.
* Adheres to the convention that most filenames are lowercase, which can be easier to type and less error-prone in case-sensitive file systems
application.cpp / class Application()
56 changes: 44 additions & 12 deletions backtesting-engine-cpp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@
942EC56B2FBEF95000CCBB5D /* redisLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942EC5652FBEF95000CCBB5D /* redisLoader.cpp */; };
942EC56C2FBEF95000CCBB5D /* redisRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942EC5662FBEF95000CCBB5D /* redisRunner.cpp */; };
942FDDE02FC5C8B20096F318 /* tradingResults.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942FDDDF2FC5C8B20096F318 /* tradingResults.cpp */; };
942FDDE12FC5C8B20096F318 /* elasticClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942FDDDE2FC5C8B20096F318 /* elasticClient.cpp */; };
942FDDE22FC5C8B20096F318 /* tradingResults.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942FDDDF2FC5C8B20096F318 /* tradingResults.cpp */; };
942FDDE32FC5C8B20096F318 /* elasticClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942FDDDE2FC5C8B20096F318 /* elasticClient.cpp */; };
942FDDE52FC5C9D30096F318 /* libcurl.4.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 942FDDE42FC5C9D30096F318 /* libcurl.4.tbd */; };
942FDDE62FC5C9DB0096F318 /* libcurl.4.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 942FDDE42FC5C9D30096F318 /* libcurl.4.tbd */; };
943398242D57E53400287A2D /* jsonParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 943398232D57E53400287A2D /* jsonParser.cpp */; };
943398252D57E53400287A2D /* jsonParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 943398232D57E53400287A2D /* jsonParser.cpp */; };
943398272D57E54000287A2D /* jsonParser.mm in Sources */ = {isa = PBXBuildFile; fileRef = 943398262D57E54000287A2D /* jsonParser.mm */; };
94364CB62D416D8D00F35B55 /* db.mm in Sources */ = {isa = PBXBuildFile; fileRef = 94364CB52D416D8000F35B55 /* db.mm */; };
9437703F2FD42FC000317424 /* elasticClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9437703D2FD42FC000317424 /* elasticClient.cpp */; };
943770402FD42FC000317424 /* elasticClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9437703D2FD42FC000317424 /* elasticClient.cpp */; };
943770452FD4396F00317424 /* boostRedisImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 943770442FD4396F00317424 /* boostRedisImpl.cpp */; };
943770462FD4396F00317424 /* boostRedisImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 943770442FD4396F00317424 /* boostRedisImpl.cpp */; };
9464E5F12FA7467200D82BAD /* symbolScale.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9464E5F02FA7467200D82BAD /* symbolScale.mm */; };
94674B872D533B4000973137 /* tradeManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94674B852D533B4000973137 /* tradeManager.cpp */; };
94674B882D533B4000973137 /* tradeManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94674B852D533B4000973137 /* tradeManager.cpp */; };
Expand Down Expand Up @@ -98,23 +100,26 @@
942EC5642FBEF95000CCBB5D /* backtestRunner.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = backtestRunner.cpp; sourceTree = "<group>"; };
942EC5652FBEF95000CCBB5D /* redisLoader.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = redisLoader.cpp; sourceTree = "<group>"; };
942EC5662FBEF95000CCBB5D /* redisRunner.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = redisRunner.cpp; sourceTree = "<group>"; };
942FDDDC2FC5C8950096F318 /* elasticClient.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = elasticClient.hpp; sourceTree = "<group>"; };
942FDDDD2FC5C8A30096F318 /* tradingResults.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = tradingResults.hpp; sourceTree = "<group>"; };
942FDDDE2FC5C8B20096F318 /* elasticClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = elasticClient.cpp; sourceTree = "<group>"; };
942FDDDF2FC5C8B20096F318 /* tradingResults.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = tradingResults.cpp; sourceTree = "<group>"; };
942FDDE42FC5C9D30096F318 /* libcurl.4.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libcurl.4.tbd; path = usr/lib/libcurl.4.tbd; sourceTree = SDKROOT; };
943398222D57E52900287A2D /* jsonParser.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = jsonParser.hpp; sourceTree = "<group>"; };
943398232D57E53400287A2D /* jsonParser.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = jsonParser.cpp; sourceTree = "<group>"; };
943398262D57E54000287A2D /* jsonParser.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = jsonParser.mm; sourceTree = "<group>"; };
94364CB52D416D8000F35B55 /* db.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = db.mm; sourceTree = "<group>"; };
9437703D2FD42FC000317424 /* elasticClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = elasticClient.cpp; sourceTree = "<group>"; };
943770412FD42FDD00317424 /* elasticClient.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = elasticClient.hpp; sourceTree = "<group>"; };
943770432FD4351100317424 /* parameterSweep.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = parameterSweep.hpp; sourceTree = "<group>"; };
943770442FD4396F00317424 /* boostRedisImpl.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = boostRedisImpl.cpp; sourceTree = "<group>"; };
944D0DC82C8C3704004DD0FC /* LICENSE.MD */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = LICENSE.MD; sourceTree = "<group>"; };
944D0DC92C8C3704004DD0FC /* build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = build.sh; sourceTree = "<group>"; };
944D0DCA2C8C3704004DD0FC /* clean.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = clean.sh; sourceTree = "<group>"; };
944D0DCC2C8C3704004DD0FC /* run.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = run.sh; sourceTree = "<group>"; };
944D0DCD2C8C3704004DD0FC /* test.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = test.sh; sourceTree = "<group>"; };
944D0DCF2C8C3704004DD0FC /* sonar-project.properties */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "sonar-project.properties"; sourceTree = "<group>"; };
944D0DD02C8C3704004DD0FC /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
944D0DD32C8C3704004DD0FC /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
945F475C2FD5607E00D19164 /* queueKeys.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = queueKeys.hpp; sourceTree = "<group>"; };
945F475D2FD5614600D19164 /* run_configuration.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = run_configuration.hpp; sourceTree = "<group>"; };
9464E5EF2FA7466900D82BAD /* symbolScale.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = symbolScale.hpp; sourceTree = "<group>"; };
9464E5F02FA7467200D82BAD /* symbolScale.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = symbolScale.mm; sourceTree = "<group>"; };
94674B822D533B1D00973137 /* trade.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = trade.hpp; sourceTree = "<group>"; };
Expand All @@ -135,6 +140,9 @@
94829FC32FCC1D1200710E6E /* env.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = env.hpp; sourceTree = "<group>"; };
94829FC42FCC1D1A00710E6E /* env.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = env.cpp; sourceTree = "<group>"; };
948A9CCD2C906A5600E23669 /* CONVENTIONS.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CONVENTIONS.md; sourceTree = "<group>"; };
94B1A5992FD735F100CB7C9F /* runLoop.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = runLoop.hpp; sourceTree = "<group>"; };
94B4F02A2FD618B300B08FB4 /* backtestLog.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = backtestLog.hpp; sourceTree = "<group>"; };
94B4F02B2FD618B300B08FB4 /* threadPool.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = threadPool.hpp; sourceTree = "<group>"; };
94BBA4512D2EA2640010E04D /* build.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = build.sh; sourceTree = "<group>"; };
94C331A02FA899A8006BD690 /* decimal_json.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = decimal_json.hpp; sourceTree = "<group>"; };
94CD832A2D2D22C900041BBA /* config.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = config.yml; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1329,6 +1337,7 @@
941B548F2D3BBA3B00E3BF64 /* trading_definitions */ = {
isa = PBXGroup;
children = (
945F475D2FD5614600D19164 /* run_configuration.hpp */,
941B54972D3BBAA200E3BF64 /* configuration.hpp */,
941B54942D3BBA8300E3BF64 /* strategy.hpp */,
941B54932D3BBA7300E3BF64 /* strategy_variables.hpp */,
Expand Down Expand Up @@ -1368,6 +1377,22 @@
path = models;
sourceTree = "<group>";
};
9437703E2FD42FC000317424 /* reporting */ = {
isa = PBXGroup;
children = (
9437703D2FD42FC000317424 /* elasticClient.cpp */,
);
path = reporting;
sourceTree = "<group>";
};
943770422FD42FDD00317424 /* reporting */ = {
isa = PBXGroup;
children = (
943770412FD42FDD00317424 /* elasticClient.hpp */,
);
path = reporting;
sourceTree = "<group>";
};
944D0DB52C8C36C0004DD0FC = {
isa = PBXGroup;
children = (
Expand All @@ -1376,7 +1401,6 @@
94DE4F772C8C3E7C00FE48FF /* include */,
9470B5A22C8C5AD0007D9CC6 /* source */,
9470B5AD2C8C5B99007D9CC6 /* tests */,
944D0DCF2C8C3704004DD0FC /* sonar-project.properties */,
944D0DD32C8C3704004DD0FC /* CMakeLists.txt */,
944D0DC82C8C3704004DD0FC /* LICENSE.MD */,
944D0DD02C8C3704004DD0FC /* README.md */,
Expand Down Expand Up @@ -1410,6 +1434,7 @@
94674B842D533B2F00973137 /* trading */ = {
isa = PBXGroup;
children = (
94B1A5992FD735F100CB7C9F /* runLoop.hpp */,
946EFF802FB9F457008D9647 /* reporting.hpp */,
94674B832D533B2F00973137 /* tradeManager.hpp */,
94674BA02D533B2F00973137 /* exitRules.hpp */,
Expand Down Expand Up @@ -1446,6 +1471,8 @@
9470B5A22C8C5AD0007D9CC6 /* source */ = {
isa = PBXGroup;
children = (
943770442FD4396F00317424 /* boostRedisImpl.cpp */,
9437703E2FD42FC000317424 /* reporting */,
941B54982D3BBAD800E3BF64 /* trading_definitions */,
94674B862D533B4000973137 /* trading */,
94674B8C2D533E7800973137 /* models */,
Expand All @@ -1454,7 +1481,6 @@
94280BA72D2FC29F00F1CF56 /* utilities */,
942EC5642FBEF95000CCBB5D /* backtestRunner.cpp */,
942EC5652FBEF95000CCBB5D /* redisLoader.cpp */,
942FDDDE2FC5C8B20096F318 /* elasticClient.cpp */,
942FDDDF2FC5C8B20096F318 /* tradingResults.cpp */,
942EC5662FBEF95000CCBB5D /* redisRunner.cpp */,
9470B5A32C8C5AD0007D9CC6 /* main.cpp */,
Expand All @@ -1481,6 +1507,10 @@
94B8C7932D3D770800E17EB6 /* utilities */ = {
isa = PBXGroup;
children = (
94B4F02A2FD618B300B08FB4 /* backtestLog.hpp */,
94B4F02B2FD618B300B08FB4 /* threadPool.hpp */,
945F475C2FD5607E00D19164 /* queueKeys.hpp */,
943770432FD4351100317424 /* parameterSweep.hpp */,
94829FC32FCC1D1200710E6E /* env.hpp */,
942EC55D2FBEF92F00CCBB5D /* redisConnection.hpp */,
94C331A02FA899A8006BD690 /* decimal_json.hpp */,
Expand Down Expand Up @@ -3600,6 +3630,7 @@
94DE4F772C8C3E7C00FE48FF /* include */ = {
isa = PBXGroup;
children = (
943770422FD42FDD00317424 /* reporting */,
94D3A7232FC1B3A600EBEA32 /* commands */,
942966D72D48E84100532862 /* models */,
94674B842D533B2F00973137 /* trading */,
Expand All @@ -3611,7 +3642,6 @@
942EC55F2FBEF93A00CCBB5D /* redisLoader.hpp */,
942EC5602FBEF93A00CCBB5D /* redisRunner.hpp */,
940A61162C92CE960083FEB8 /* serviceA.hpp */,
942FDDDC2FC5C8950096F318 /* elasticClient.hpp */,
943398222D57E52900287A2D /* jsonParser.hpp */,
942FDDDD2FC5C8A30096F318 /* tradingResults.hpp */,
940A61122C92CE210083FEB8 /* configManager.hpp */,
Expand Down Expand Up @@ -3720,14 +3750,15 @@
9470B5A42C8C5AD0007D9CC6 /* main.cpp in Sources */,
943398252D57E53400287A2D /* jsonParser.cpp in Sources */,
942FDDE02FC5C8B20096F318 /* tradingResults.cpp in Sources */,
942FDDE12FC5C8B20096F318 /* elasticClient.cpp in Sources */,
94D3A72A2FC1B41500EBEA32 /* runCommand.cpp in Sources */,
943770452FD4396F00317424 /* boostRedisImpl.cpp in Sources */,
942EC56A2FBEF95000CCBB5D /* backtestRunner.cpp in Sources */,
942EC56B2FBEF95000CCBB5D /* redisLoader.cpp in Sources */,
94829FC52FCC1D1A00710E6E /* env.cpp in Sources */,
942EC56C2FBEF95000CCBB5D /* redisRunner.cpp in Sources */,
94280BA32D2FC00200F1CF56 /* base64.cpp in Sources */,
94674B8E2D533E7800973137 /* trade.cpp in Sources */,
943770402FD42FC000317424 /* elasticClient.cpp in Sources */,
941B549B2D3BBADE00E3BF64 /* trading_definitions_json.cpp in Sources */,
946EFF7E2FB9F44E008D9647 /* reporting.cpp in Sources */,
94674B872D533B4000973137 /* tradeManager.cpp in Sources */,
Expand Down Expand Up @@ -3755,6 +3786,7 @@
942EC5692FBEF95000CCBB5D /* redisRunner.cpp in Sources */,
94280BA42D2FC00200F1CF56 /* base64.cpp in Sources */,
94674B8D2D533E7800973137 /* trade.cpp in Sources */,
943770462FD4396F00317424 /* boostRedisImpl.cpp in Sources */,
941B549A2D3BBADE00E3BF64 /* trading_definitions_json.cpp in Sources */,
94D3A7292FC1B41500EBEA32 /* runCommand.cpp in Sources */,
94D601102FA9CD700066F51A /* randomStrategy.cpp in Sources */,
Expand All @@ -3766,7 +3798,7 @@
946EFF7F2FB9F44E008D9647 /* reporting.cpp in Sources */,
943398272D57E54000287A2D /* jsonParser.mm in Sources */,
942FDDE22FC5C8B20096F318 /* tradingResults.cpp in Sources */,
942FDDE32FC5C8B20096F318 /* elasticClient.cpp in Sources */,
9437703F2FD42FC000317424 /* elasticClient.cpp in Sources */,
9470B5B62C8C5BFD007D9CC6 /* main.cpp in Sources */,
94364CB62D416D8D00F35B55 /* db.mm in Sources */,
940A61142C92CE210083FEB8 /* configManager.cpp in Sources */,
Expand All @@ -3783,7 +3815,7 @@
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++23";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
Expand Down Expand Up @@ -3844,7 +3876,7 @@
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++23";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
Expand Down
13 changes: 13 additions & 0 deletions include/backtestRunner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,20 @@

#pragma once
#include <string>
#include <vector>
#include "models/priceData.hpp"
#include "trading_definitions/configuration.hpp"

// Pulls all tick data for the run's symbols/window out of QuestDB. Expensive —
// call once per run and reuse the result across that run's strategies.
std::vector<PriceData> loadTicks(const std::string& questdbHost,
const std::string& symbolsCsv,
int lastMonths);

// Runs one backtest against already-loaded ticks (no QuestDB access).
void runBacktestOnTicks(const std::vector<PriceData>& ticks,
const trading_definitions::Configuration& config);

// Convenience for the direct path: loads ticks then runs a single backtest.
int runBacktest(const std::string& questdbHost,
const trading_definitions::Configuration& config);
5 changes: 3 additions & 2 deletions include/commands/loadCommand.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

#pragma once

// Backs the `load` subcommand: LPUSHes a strategy JSON (defined in
// source/commands/loadCommand.cpp) onto the Redis `strategy_queue`.
// Backs the `load` subcommand: for one RUN_ID, LPUSHes every swept strategy onto
// BACKTESTING_QUEUE_STRATEGY:<RUN_ID>, then LPUSHes the run descriptor onto
// BACKTESTING_QUEUE_RUN (see source/commands/loadCommand.cpp).
class LoadCommand {
public:
static int run();
Expand Down
Loading
Loading