FastMM documentation
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
live.hpp
Go to the documentation of this file.
1#pragma once
2// fastmm::cli::live: the fastmm-live command line as a library function (fastmm::live), so a
3// strategy project's live app is a 3-line main:
4//
5// #include "fastmm/cli/live.hpp"
6// #include "mm/strategies.hpp"
7// int main(int argc, char** argv) { return fastmm::cli::live(argc, argv,
8// {mm::register_strategies}); }
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; log lines keep the `fastmm-live:` tag. A session installs process-wide SIGINT and
13// SIGTERM handlers (they trip the kill switch, cancel all orders and stop). Run `--help` for the
14// flags and exit codes.
16
17#include <initializer_list>
18#include <span>
19
20namespace fastmm::cli {
21
22int live(int argc, char** argv, std::span<const StrategyModule> modules);
23
24inline int live(int argc, char** argv, std::initializer_list<StrategyModule> modules = {}) {
25 return live(argc, argv, std::span<const StrategyModule>(modules.begin(), modules.size()));
27
28} // namespace fastmm::cli
Strategy modules (ADR-0012, section 5): one registration function per strategy library.
Definition backtest.hpp:20
int live(int argc, char **argv, std::span< const StrategyModule > modules)