-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.cpp
More file actions
30 lines (24 loc) · 831 Bytes
/
Copy pathmain.cpp
File metadata and controls
30 lines (24 loc) · 831 Bytes
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
// 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 <string_view>
// backtesting engine headers
#include "loadCommand.hpp"
#include "runCommand.hpp"
int main(int argc, const char* argv[]) {
if (argc < 2) {
std::cerr << "BacktestingEngine: missing subcommand. See README.md for usage."
<< std::endl;
return 1;
}
const std::string_view subcommand = argv[1];
if (subcommand == "load") return LoadCommand::run(argc, argv);
if (subcommand == "run") return RunCommand::run(argc, argv);
std::cerr << "BacktestingEngine: unknown subcommand. See README.md for usage."
<< std::endl;
return 1;
}