25#include "fastmm/core/engine.hpp"
27#include "fastmm/core/treasury.hpp"
28#include "fastmm/sim/market_generator.hpp"
29#include "fastmm/sim/sim_transport.hpp"
46struct BacktestConfig {
114 void set_param(
const std::string& key,
const std::string& value) {
params[key] = value; }
Definition config.hpp:302
Dense-by-id table built at startup; symbol lookup is a sorted FlatMap keyed by (venue,...
Definition instrument.hpp:141
Typed configuration (8.7).
Instrument: the single definition of a tradable contract (5.3 / 5.15).
Definition backtest_config.hpp:39
InitialState
Where the strategy's starting state comes from ([backtest] initial_state).
Definition backtest_config.hpp:42
@ StateFile
[strategy] state_file, when set
@ None
nothing: the strategy starts fresh
@ Journal
the data journal's (journal_state.hpp), with the session's positions
constexpr Duration milliseconds(std::int64_t v) noexcept
Definition time.hpp:38
constexpr Duration seconds(std::int64_t v) noexcept
Definition time.hpp:41
std::map< std::string, std::string > ParamMap
Definition params.hpp:119
Strategy parameter schema (8.6, ADR-0012).
std::int64_t ns
Definition time.hpp:23
Definition engine_config.hpp:21
Definition backtest_config.hpp:48
double initial_capital
reporting only (drawdown %)
Definition backtest_config.hpp:59
AccountingSpec accounting
[accounting] and the venue names its sources name (Config::venues order).
Definition backtest_config.hpp:62
UnderlyingPlan underlying_plan(const InstrumentTable &table) const
The [risk.underlying] plan for table (throws ConfigError when the spec does not fit it).
std::string path
Definition backtest_config.hpp:71
std::vector< TreasuryConfig > treasuries
The pool treasuries ([venues.
Definition backtest_config.hpp:89
std::string strategy
registry name (apps / Python); ignored by run_backtest<S>()
Definition backtest_config.hpp:51
std::string config_toml
Effective configuration embedded in journal_out (Config::effective_toml(); from_config() sets it,...
Definition backtest_config.hpp:77
InstrumentTable instruments
Definition backtest_config.hpp:50
std::string output_dir
Definition backtest_config.hpp:72
bool balances_from_journal
Start each venue's account (transport.accounts) from the first balance snapshot the journal source re...
Definition backtest_config.hpp:85
Duration reorder_window
Recorded data reaches the simulated venue in venue-time order (sim/venue_order.hpp),...
Definition backtest_config.hpp:100
static BacktestConfig single_instrument(std::string_view symbol, Price tick, Qty lot)
One instrument (venue 0) with the given tick/lot; generator tick/lot follow (examples).
std::string source
"synthetic" | "journal" | "csv" | "" (caller supplies the source)
Definition backtest_config.hpp:70
bool params_from_journal
The data journal's parameter updates reach the strategy at the times the session received them (sim::...
Definition backtest_config.hpp:97
InitialState initial_state
The strategy's starting state; Journal also starts the engine's positions where the recorded session ...
Definition backtest_config.hpp:94
static BacktestConfig from_config(const Config &cfg)
Throws ConfigError on invalid values.
bool measure_wall_clock
Definition backtest_config.hpp:78
Timestamp start
Definition backtest_config.hpp:56
std::string journal_out
record the run to this .fmj (empty = no journal)
Definition backtest_config.hpp:73
FxPlan fx_plan(const InstrumentTable &table)
The FX plan for table under accounting (throws ConfigError when a limit reads the totals and the tabl...
ParamMap params
Definition backtest_config.hpp:52
int generator_seed_levels
Definition backtest_config.hpp:69
sim::SimTransportConfig transport
Definition backtest_config.hpp:53
std::vector< std::string > warnings
from_config: Config::warnings plus unknown [backtest] keys, each naming the key and its line.
Definition backtest_config.hpp:68
void set_seed(std::uint64_t s) noexcept
Seeds the synthetic market and the latency model.
Definition backtest_config.hpp:118
std::uint64_t seed
synthetic market + latency model (engine.rng_seed is separate)
Definition backtest_config.hpp:55
Duration transfer_latency
[backtest] transfer_latency_ms: a simulated transfer is carried out this long after it is sent.
Definition backtest_config.hpp:91
sim::MarketGeneratorParams generator
Definition backtest_config.hpp:54
UnderlyingSpec underlying
[risk.underlying]: from_config() builds engine.underlying from it for instruments; replay builds it a...
Definition backtest_config.hpp:66
EngineConfig engine
Definition backtest_config.hpp:49
Duration duration
synthetic horizon
Definition backtest_config.hpp:57
std::vector< Duration > markout_horizons
Post-fill markout horizons in simulated time; empty turns markouts off.
Definition backtest_config.hpp:82
Duration equity_bar
Definition backtest_config.hpp:58
std::vector< std::string > venue_names
Definition backtest_config.hpp:63
void set_param(const std::string &key, const std::string &value)
"key=value" strategy parameter override (CLI --param).
Definition backtest_config.hpp:116