FastMM documentation
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
backtest.hpp
Go to the documentation of this file.
1#pragma once
2// fastmm::cli::backtest: the fastmm-backtest command line as a library function (fastmm::backtest).
3//
4// #include "fastmm/cli/backtest.hpp"
5// #include "mm/strategies.hpp"
6// int main(int argc, char** argv) {
7// return fastmm::cli::backtest(argc, argv, {mm::register_strategies});
8// }
9//
10// The built-in strategies are always registered, then every module in order; a strategy name
11// registered by different code exits with code 3. Usage and error messages are prefixed with the
12// program name. Run `--help` for the flags and exit codes.
14
15#include <initializer_list>
16#include <span>
17
18namespace fastmm::cli {
19
20int backtest(int argc, char** argv, std::span<const StrategyModule> modules);
21
22inline int backtest(int argc, char** argv, std::initializer_list<StrategyModule> modules = {}) {
23 return backtest(argc, argv, std::span<const StrategyModule>(modules.begin(), modules.size()));
25
26} // namespace fastmm::cli
Strategy modules (ADR-0012, section 5): one registration function per strategy library.
Definition backtest.hpp:20
int backtest(int argc, char **argv, std::span< const StrategyModule > modules)