Skip to content

Commit 4c54837

Browse files
authored
43 expand load command to compute multiple sweep parameters (#44)
* Added sweep methods * Removed cache * Refactoring to put a strategy into redis, and then a queue of runs to sweep * Refactoring operations to be within a thread to scale up backtesting sweeps * fixed the build * Fix ubuntu build * Fixing the header references for explicit include * Updating tests and refactoring operations * further refactoring, renaming methods
1 parent 7ea4952 commit 4c54837

44 files changed

Lines changed: 1620 additions & 228 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ jobs:
8080
fetch-depth: 0
8181
- name: Install dependencies
8282
run: sudo apt install -y libssl-dev libpq-dev libcurl4-openssl-dev
83+
# ubuntu-latest (24.04) defaults to GCC 13, whose libstdc++ lacks the
84+
# C++23 <print> header (std::print/std::println). That header was added
85+
# in GCC 14, so install it and make it the default compiler for every
86+
# subsequent step (dependency build, CMake configure, build-wrapper).
87+
- name: Install GCC 14 (for C++23 <print>)
88+
run: |
89+
sudo apt install -y gcc-14 g++-14
90+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
91+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
8392
# Ubuntu's apt Boost (1.83 on 24.04) predates Boost.Redis, which was added
8493
# in Boost 1.84, so <boost/redis.hpp> is absent. Install a newer Boost.
8594
# Boost.Redis/Asio are header-only, so we only need the headers plus the

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,7 @@ xcuserdata/
4040
xcuserstate/
4141
TestResult.xcresult/
4242
sonarqube-generic-coverage.xml
43-
external/libpqxx
43+
.cache/clangd/
44+
.clangd
45+
dump.rdb
46+
.infisical.json

CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ execute_process(
1111
project(BacktestingEngine)
1212

1313
# Set the C++ standard
14-
set(CMAKE_CXX_STANDARD 20)
14+
set(CMAKE_CXX_STANDARD 23)
1515
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1616

1717
# Configure libpqxx build
@@ -40,6 +40,7 @@ include_directories(
4040
${CMAKE_SOURCE_DIR}/include/commands
4141
${CMAKE_SOURCE_DIR}/include/utilities
4242
${CMAKE_SOURCE_DIR}/include/models
43+
${CMAKE_SOURCE_DIR}/include/reporting
4344
${CMAKE_SOURCE_DIR}/include/trading
4445
${CMAKE_SOURCE_DIR}/include/trading_definitions
4546
${CMAKE_SOURCE_DIR}/include/strategies
@@ -64,9 +65,9 @@ if(APPLE)
6465
endif()
6566

6667
# Boost (Homebrew) — Boost.Redis is header-only but its implementation is
67-
# compiled into one TU via <boost/redis/src.hpp> (included in
68-
# source/redisRunner.cpp). It pulls in Boost.Asio's SSL layer, which needs
69-
# OpenSSL.
68+
# compiled into one dedicated TU via <boost/redis/src.hpp> (source/
69+
# boostRedisImpl.cpp), which isolates its macro/SSL pollution from the rest of
70+
# the build. It pulls in Boost.Asio's SSL layer, which needs OpenSSL.
7071
find_package(Boost REQUIRED CONFIG)
7172
find_package(OpenSSL REQUIRED)
7273
find_package(Threads REQUIRED)

CONVENTIONS.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
### Headers folder (./source/include)
2-
Header files are saved within ./source/include
2+
Header-only headers in include/ are globally available and source/*.cpp is globbed automatically.
33

44
### Pragma once
5-
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.
5+
Headers should use `#pragma once` directive to guard to prevent multiple inclusions of the same header file.
66

77
### Lower Camel Case file names
8-
application.cpp / class Application()
9-
10-
* Often preferred in Unix-like environments and by many open-source projects.
11-
* Adheres to the convention that most filenames are lowercase, which can be easier to type and less error-prone in case-sensitive file systems
8+
application.cpp / class Application()

backtesting-engine-cpp.xcodeproj/project.pbxproj

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@
2626
942EC56B2FBEF95000CCBB5D /* redisLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942EC5652FBEF95000CCBB5D /* redisLoader.cpp */; };
2727
942EC56C2FBEF95000CCBB5D /* redisRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942EC5662FBEF95000CCBB5D /* redisRunner.cpp */; };
2828
942FDDE02FC5C8B20096F318 /* tradingResults.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942FDDDF2FC5C8B20096F318 /* tradingResults.cpp */; };
29-
942FDDE12FC5C8B20096F318 /* elasticClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942FDDDE2FC5C8B20096F318 /* elasticClient.cpp */; };
3029
942FDDE22FC5C8B20096F318 /* tradingResults.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942FDDDF2FC5C8B20096F318 /* tradingResults.cpp */; };
31-
942FDDE32FC5C8B20096F318 /* elasticClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942FDDDE2FC5C8B20096F318 /* elasticClient.cpp */; };
3230
942FDDE52FC5C9D30096F318 /* libcurl.4.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 942FDDE42FC5C9D30096F318 /* libcurl.4.tbd */; };
3331
942FDDE62FC5C9DB0096F318 /* libcurl.4.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 942FDDE42FC5C9D30096F318 /* libcurl.4.tbd */; };
3432
943398242D57E53400287A2D /* jsonParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 943398232D57E53400287A2D /* jsonParser.cpp */; };
3533
943398252D57E53400287A2D /* jsonParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 943398232D57E53400287A2D /* jsonParser.cpp */; };
3634
943398272D57E54000287A2D /* jsonParser.mm in Sources */ = {isa = PBXBuildFile; fileRef = 943398262D57E54000287A2D /* jsonParser.mm */; };
3735
94364CB62D416D8D00F35B55 /* db.mm in Sources */ = {isa = PBXBuildFile; fileRef = 94364CB52D416D8000F35B55 /* db.mm */; };
36+
9437703F2FD42FC000317424 /* elasticClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9437703D2FD42FC000317424 /* elasticClient.cpp */; };
37+
943770402FD42FC000317424 /* elasticClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9437703D2FD42FC000317424 /* elasticClient.cpp */; };
38+
943770452FD4396F00317424 /* boostRedisImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 943770442FD4396F00317424 /* boostRedisImpl.cpp */; };
39+
943770462FD4396F00317424 /* boostRedisImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 943770442FD4396F00317424 /* boostRedisImpl.cpp */; };
3840
9464E5F12FA7467200D82BAD /* symbolScale.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9464E5F02FA7467200D82BAD /* symbolScale.mm */; };
3941
94674B872D533B4000973137 /* tradeManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94674B852D533B4000973137 /* tradeManager.cpp */; };
4042
94674B882D533B4000973137 /* tradeManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94674B852D533B4000973137 /* tradeManager.cpp */; };
@@ -98,23 +100,26 @@
98100
942EC5642FBEF95000CCBB5D /* backtestRunner.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = backtestRunner.cpp; sourceTree = "<group>"; };
99101
942EC5652FBEF95000CCBB5D /* redisLoader.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = redisLoader.cpp; sourceTree = "<group>"; };
100102
942EC5662FBEF95000CCBB5D /* redisRunner.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = redisRunner.cpp; sourceTree = "<group>"; };
101-
942FDDDC2FC5C8950096F318 /* elasticClient.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = elasticClient.hpp; sourceTree = "<group>"; };
102103
942FDDDD2FC5C8A30096F318 /* tradingResults.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = tradingResults.hpp; sourceTree = "<group>"; };
103-
942FDDDE2FC5C8B20096F318 /* elasticClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = elasticClient.cpp; sourceTree = "<group>"; };
104104
942FDDDF2FC5C8B20096F318 /* tradingResults.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = tradingResults.cpp; sourceTree = "<group>"; };
105105
942FDDE42FC5C9D30096F318 /* libcurl.4.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libcurl.4.tbd; path = usr/lib/libcurl.4.tbd; sourceTree = SDKROOT; };
106106
943398222D57E52900287A2D /* jsonParser.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = jsonParser.hpp; sourceTree = "<group>"; };
107107
943398232D57E53400287A2D /* jsonParser.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = jsonParser.cpp; sourceTree = "<group>"; };
108108
943398262D57E54000287A2D /* jsonParser.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = jsonParser.mm; sourceTree = "<group>"; };
109109
94364CB52D416D8000F35B55 /* db.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = db.mm; sourceTree = "<group>"; };
110+
9437703D2FD42FC000317424 /* elasticClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = elasticClient.cpp; sourceTree = "<group>"; };
111+
943770412FD42FDD00317424 /* elasticClient.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = elasticClient.hpp; sourceTree = "<group>"; };
112+
943770432FD4351100317424 /* parameterSweep.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = parameterSweep.hpp; sourceTree = "<group>"; };
113+
943770442FD4396F00317424 /* boostRedisImpl.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = boostRedisImpl.cpp; sourceTree = "<group>"; };
110114
944D0DC82C8C3704004DD0FC /* LICENSE.MD */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = LICENSE.MD; sourceTree = "<group>"; };
111115
944D0DC92C8C3704004DD0FC /* build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = build.sh; sourceTree = "<group>"; };
112116
944D0DCA2C8C3704004DD0FC /* clean.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = clean.sh; sourceTree = "<group>"; };
113117
944D0DCC2C8C3704004DD0FC /* run.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = run.sh; sourceTree = "<group>"; };
114118
944D0DCD2C8C3704004DD0FC /* test.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = test.sh; sourceTree = "<group>"; };
115-
944D0DCF2C8C3704004DD0FC /* sonar-project.properties */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "sonar-project.properties"; sourceTree = "<group>"; };
116119
944D0DD02C8C3704004DD0FC /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
117120
944D0DD32C8C3704004DD0FC /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
121+
945F475C2FD5607E00D19164 /* queueKeys.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = queueKeys.hpp; sourceTree = "<group>"; };
122+
945F475D2FD5614600D19164 /* run_configuration.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = run_configuration.hpp; sourceTree = "<group>"; };
118123
9464E5EF2FA7466900D82BAD /* symbolScale.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = symbolScale.hpp; sourceTree = "<group>"; };
119124
9464E5F02FA7467200D82BAD /* symbolScale.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = symbolScale.mm; sourceTree = "<group>"; };
120125
94674B822D533B1D00973137 /* trade.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = trade.hpp; sourceTree = "<group>"; };
@@ -135,6 +140,9 @@
135140
94829FC32FCC1D1200710E6E /* env.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = env.hpp; sourceTree = "<group>"; };
136141
94829FC42FCC1D1A00710E6E /* env.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = env.cpp; sourceTree = "<group>"; };
137142
948A9CCD2C906A5600E23669 /* CONVENTIONS.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CONVENTIONS.md; sourceTree = "<group>"; };
143+
94B1A5992FD735F100CB7C9F /* runLoop.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = runLoop.hpp; sourceTree = "<group>"; };
144+
94B4F02A2FD618B300B08FB4 /* backtestLog.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = backtestLog.hpp; sourceTree = "<group>"; };
145+
94B4F02B2FD618B300B08FB4 /* threadPool.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = threadPool.hpp; sourceTree = "<group>"; };
138146
94BBA4512D2EA2640010E04D /* build.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = build.sh; sourceTree = "<group>"; };
139147
94C331A02FA899A8006BD690 /* decimal_json.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = decimal_json.hpp; sourceTree = "<group>"; };
140148
94CD832A2D2D22C900041BBA /* config.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = config.yml; sourceTree = "<group>"; };
@@ -1329,6 +1337,7 @@
13291337
941B548F2D3BBA3B00E3BF64 /* trading_definitions */ = {
13301338
isa = PBXGroup;
13311339
children = (
1340+
945F475D2FD5614600D19164 /* run_configuration.hpp */,
13321341
941B54972D3BBAA200E3BF64 /* configuration.hpp */,
13331342
941B54942D3BBA8300E3BF64 /* strategy.hpp */,
13341343
941B54932D3BBA7300E3BF64 /* strategy_variables.hpp */,
@@ -1368,6 +1377,22 @@
13681377
path = models;
13691378
sourceTree = "<group>";
13701379
};
1380+
9437703E2FD42FC000317424 /* reporting */ = {
1381+
isa = PBXGroup;
1382+
children = (
1383+
9437703D2FD42FC000317424 /* elasticClient.cpp */,
1384+
);
1385+
path = reporting;
1386+
sourceTree = "<group>";
1387+
};
1388+
943770422FD42FDD00317424 /* reporting */ = {
1389+
isa = PBXGroup;
1390+
children = (
1391+
943770412FD42FDD00317424 /* elasticClient.hpp */,
1392+
);
1393+
path = reporting;
1394+
sourceTree = "<group>";
1395+
};
13711396
944D0DB52C8C36C0004DD0FC = {
13721397
isa = PBXGroup;
13731398
children = (
@@ -1376,7 +1401,6 @@
13761401
94DE4F772C8C3E7C00FE48FF /* include */,
13771402
9470B5A22C8C5AD0007D9CC6 /* source */,
13781403
9470B5AD2C8C5B99007D9CC6 /* tests */,
1379-
944D0DCF2C8C3704004DD0FC /* sonar-project.properties */,
13801404
944D0DD32C8C3704004DD0FC /* CMakeLists.txt */,
13811405
944D0DC82C8C3704004DD0FC /* LICENSE.MD */,
13821406
944D0DD02C8C3704004DD0FC /* README.md */,
@@ -1410,6 +1434,7 @@
14101434
94674B842D533B2F00973137 /* trading */ = {
14111435
isa = PBXGroup;
14121436
children = (
1437+
94B1A5992FD735F100CB7C9F /* runLoop.hpp */,
14131438
946EFF802FB9F457008D9647 /* reporting.hpp */,
14141439
94674B832D533B2F00973137 /* tradeManager.hpp */,
14151440
94674BA02D533B2F00973137 /* exitRules.hpp */,
@@ -1446,6 +1471,8 @@
14461471
9470B5A22C8C5AD0007D9CC6 /* source */ = {
14471472
isa = PBXGroup;
14481473
children = (
1474+
943770442FD4396F00317424 /* boostRedisImpl.cpp */,
1475+
9437703E2FD42FC000317424 /* reporting */,
14491476
941B54982D3BBAD800E3BF64 /* trading_definitions */,
14501477
94674B862D533B4000973137 /* trading */,
14511478
94674B8C2D533E7800973137 /* models */,
@@ -1454,7 +1481,6 @@
14541481
94280BA72D2FC29F00F1CF56 /* utilities */,
14551482
942EC5642FBEF95000CCBB5D /* backtestRunner.cpp */,
14561483
942EC5652FBEF95000CCBB5D /* redisLoader.cpp */,
1457-
942FDDDE2FC5C8B20096F318 /* elasticClient.cpp */,
14581484
942FDDDF2FC5C8B20096F318 /* tradingResults.cpp */,
14591485
942EC5662FBEF95000CCBB5D /* redisRunner.cpp */,
14601486
9470B5A32C8C5AD0007D9CC6 /* main.cpp */,
@@ -1481,6 +1507,10 @@
14811507
94B8C7932D3D770800E17EB6 /* utilities */ = {
14821508
isa = PBXGroup;
14831509
children = (
1510+
94B4F02A2FD618B300B08FB4 /* backtestLog.hpp */,
1511+
94B4F02B2FD618B300B08FB4 /* threadPool.hpp */,
1512+
945F475C2FD5607E00D19164 /* queueKeys.hpp */,
1513+
943770432FD4351100317424 /* parameterSweep.hpp */,
14841514
94829FC32FCC1D1200710E6E /* env.hpp */,
14851515
942EC55D2FBEF92F00CCBB5D /* redisConnection.hpp */,
14861516
94C331A02FA899A8006BD690 /* decimal_json.hpp */,
@@ -3600,6 +3630,7 @@
36003630
94DE4F772C8C3E7C00FE48FF /* include */ = {
36013631
isa = PBXGroup;
36023632
children = (
3633+
943770422FD42FDD00317424 /* reporting */,
36033634
94D3A7232FC1B3A600EBEA32 /* commands */,
36043635
942966D72D48E84100532862 /* models */,
36053636
94674B842D533B2F00973137 /* trading */,
@@ -3611,7 +3642,6 @@
36113642
942EC55F2FBEF93A00CCBB5D /* redisLoader.hpp */,
36123643
942EC5602FBEF93A00CCBB5D /* redisRunner.hpp */,
36133644
940A61162C92CE960083FEB8 /* serviceA.hpp */,
3614-
942FDDDC2FC5C8950096F318 /* elasticClient.hpp */,
36153645
943398222D57E52900287A2D /* jsonParser.hpp */,
36163646
942FDDDD2FC5C8A30096F318 /* tradingResults.hpp */,
36173647
940A61122C92CE210083FEB8 /* configManager.hpp */,
@@ -3720,14 +3750,15 @@
37203750
9470B5A42C8C5AD0007D9CC6 /* main.cpp in Sources */,
37213751
943398252D57E53400287A2D /* jsonParser.cpp in Sources */,
37223752
942FDDE02FC5C8B20096F318 /* tradingResults.cpp in Sources */,
3723-
942FDDE12FC5C8B20096F318 /* elasticClient.cpp in Sources */,
37243753
94D3A72A2FC1B41500EBEA32 /* runCommand.cpp in Sources */,
3754+
943770452FD4396F00317424 /* boostRedisImpl.cpp in Sources */,
37253755
942EC56A2FBEF95000CCBB5D /* backtestRunner.cpp in Sources */,
37263756
942EC56B2FBEF95000CCBB5D /* redisLoader.cpp in Sources */,
37273757
94829FC52FCC1D1A00710E6E /* env.cpp in Sources */,
37283758
942EC56C2FBEF95000CCBB5D /* redisRunner.cpp in Sources */,
37293759
94280BA32D2FC00200F1CF56 /* base64.cpp in Sources */,
37303760
94674B8E2D533E7800973137 /* trade.cpp in Sources */,
3761+
943770402FD42FC000317424 /* elasticClient.cpp in Sources */,
37313762
941B549B2D3BBADE00E3BF64 /* trading_definitions_json.cpp in Sources */,
37323763
946EFF7E2FB9F44E008D9647 /* reporting.cpp in Sources */,
37333764
94674B872D533B4000973137 /* tradeManager.cpp in Sources */,
@@ -3755,6 +3786,7 @@
37553786
942EC5692FBEF95000CCBB5D /* redisRunner.cpp in Sources */,
37563787
94280BA42D2FC00200F1CF56 /* base64.cpp in Sources */,
37573788
94674B8D2D533E7800973137 /* trade.cpp in Sources */,
3789+
943770462FD4396F00317424 /* boostRedisImpl.cpp in Sources */,
37583790
941B549A2D3BBADE00E3BF64 /* trading_definitions_json.cpp in Sources */,
37593791
94D3A7292FC1B41500EBEA32 /* runCommand.cpp in Sources */,
37603792
94D601102FA9CD700066F51A /* randomStrategy.cpp in Sources */,
@@ -3766,7 +3798,7 @@
37663798
946EFF7F2FB9F44E008D9647 /* reporting.cpp in Sources */,
37673799
943398272D57E54000287A2D /* jsonParser.mm in Sources */,
37683800
942FDDE22FC5C8B20096F318 /* tradingResults.cpp in Sources */,
3769-
942FDDE32FC5C8B20096F318 /* elasticClient.cpp in Sources */,
3801+
9437703F2FD42FC000317424 /* elasticClient.cpp in Sources */,
37703802
9470B5B62C8C5BFD007D9CC6 /* main.cpp in Sources */,
37713803
94364CB62D416D8D00F35B55 /* db.mm in Sources */,
37723804
940A61142C92CE210083FEB8 /* configManager.cpp in Sources */,
@@ -3783,7 +3815,7 @@
37833815
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
37843816
CLANG_ANALYZER_NONNULL = YES;
37853817
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
3786-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
3818+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++23";
37873819
CLANG_ENABLE_MODULES = YES;
37883820
CLANG_ENABLE_OBJC_ARC = YES;
37893821
CLANG_ENABLE_OBJC_WEAK = YES;
@@ -3844,7 +3876,7 @@
38443876
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
38453877
CLANG_ANALYZER_NONNULL = YES;
38463878
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
3847-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
3879+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++23";
38483880
CLANG_ENABLE_MODULES = YES;
38493881
CLANG_ENABLE_OBJC_ARC = YES;
38503882
CLANG_ENABLE_OBJC_WEAK = YES;

include/backtestRunner.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,20 @@
66

77
#pragma once
88
#include <string>
9+
#include <vector>
10+
#include "models/priceData.hpp"
911
#include "trading_definitions/configuration.hpp"
1012

13+
// Pulls all tick data for the run's symbols/window out of QuestDB. Expensive —
14+
// call once per run and reuse the result across that run's strategies.
15+
std::vector<PriceData> loadTicks(const std::string& questdbHost,
16+
const std::string& symbolsCsv,
17+
int lastMonths);
18+
19+
// Runs one backtest against already-loaded ticks (no QuestDB access).
20+
void runBacktestOnTicks(const std::vector<PriceData>& ticks,
21+
const trading_definitions::Configuration& config);
22+
23+
// Convenience for the direct path: loads ticks then runs a single backtest.
1124
int runBacktest(const std::string& questdbHost,
1225
const trading_definitions::Configuration& config);

include/commands/loadCommand.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66

77
#pragma once
88

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

0 commit comments

Comments
 (0)