-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.cpp
More file actions
47 lines (36 loc) · 1.23 KB
/
Copy pathmain.cpp
File metadata and controls
47 lines (36 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Backtesting Engine in C++
//
// (c) 2026 Ryan McCaffery | https://mccaffers.com
// This code is licensed under MIT license (see LICENSE.txt for details)
// ---------------------------------------
// std headers
#include <iostream>
#include <vector>
#include <memory>
#include <string>
#include <iomanip>
// external headers
#include <nlohmann/json.hpp>
// backtesting engine headers
#include "configManager.hpp"
#include "serviceA.hpp"
#include "databaseConnection.hpp"
#include "base64.hpp"
#include "trading_definitions.hpp" // For everything
#include "tradeManager.hpp"
#include "jsonParser.hpp"
#include "sqlManager.hpp"
#include "operations.hpp"
using json = nlohmann::json;
// Entry point. Expects two command-line arguments:
// argv[1] — hostname/IP of the QuestDB instance
// argv[2] — Base64-encoded JSON strategy configuration
int main(int argc, const char * argv[]) {
DatabaseConnection db(argv[1], 8812, "qdb", "admin", "quest");
JsonParser::parseConfigurationFromBase64(argv[2]);
std::vector<std::string> symbols = {"AUSIDXAUD", "EURUSD"};
std::vector<PriceData> ticks = SqlManager::streamPriceData(db, symbols, 1);
printf("Total ticks streamed: %zu\n", ticks.size());
Operations::run(ticks);
return 0;
}