|
FastMM C++ API 0.14.0
Public headers, tier 1 and tier 2
|
BacktestRunner (8.4): wires Engine<S, SimClock, SimTransport, InlineFeed> to a SimDriver and collects a BacktestResult. More...
#include "fastmm/backtest/backtest_config.hpp"#include "fastmm/backtest/data_source.hpp"#include "fastmm/backtest/result.hpp"#include "fastmm/backtest/synthetic_source.hpp"#include "fastmm/core/engine_runner.hpp"#include "fastmm/sim/recorded_session.hpp"#include "fastmm/sim/sim_backend.hpp"#include "fastmm/strategies/module.hpp"#include "fastmm/strategies/registry.hpp"#include <cstddef>#include <cstdint>#include <functional>#include <memory>#include <span>#include <string_view>Go to the source code of this file.
Classes | |
| class | fastmm::bt::BacktestSession |
| class | fastmm::bt::BacktestRunner< S > |
| Convenience wrapper that owns the config. More... | |
Namespaces | |
| namespace | fastmm |
| namespace | fastmm::bt |
Functions | |
| template<StrategyLike S> | |
| BacktestResult | fastmm::bt::run_backtest (const BacktestConfig &cfg, MdSource *source=nullptr) |
| BacktestResult | fastmm::bt::run_backtest (const BacktestConfig &cfg, std::string_view strategy, MdSource *source=nullptr) |
| Registry path (registers the built-in strategies first). | |
| BacktestConfig | fastmm::bt::shared_start (BacktestConfig cfg) |
cfg for runs that start from one place: the points of a sweep, the folds of a walk-forward, the arms of an [ab] branch test. | |
| SyntheticSourceConfig | fastmm::bt::synthetic_source_config (const BacktestConfig &cfg) |
The SyntheticSource a run with source == nullptr replays under the L2 queue fill model. | |
| void | fastmm::bt::warn_unfed_instruments (const InstrumentTable &instruments, std::span< const std::uint64_t > by_instrument) |
| Logs a warning for each instrument the data gave no events, and for the events that named an instrument id past the table. | |
| std::unique_ptr< MdSource > | fastmm::bt::open_data (std::string_view spec, const InstrumentTable *instruments=nullptr) |
Resolves --data through the data-source registry (data_registry.hpp): "\<name\>:\<args\>", or a bare *.fmj / *.csv path. | |
| std::unique_ptr< MdSource > | fastmm::bt::open_source (const BacktestConfig &cfg) |
| Source for [backtest] source / path. | |
BacktestRunner (8.4): wires Engine<S, SimClock, SimTransport, InlineFeed> to a SimDriver and collects a BacktestResult.
Two entry points share one BacktestSession:
run_backtest<MyStrategy>(cfg, source) // template: no registration needed run_backtest(cfg, "basic_mm", source) // registry: apps, Python, sweeps
source == nullptr selects the synthetic market: with the matching fill model the MarketGenerator is coupled to the venue (strategy orders rest in the same book as the synthetic flow); with the L2 queue model a SyntheticSource stream is replayed exactly like historical data. A non-null source is read from its current position (reset() it first to reuse one).