|
| | BacktestSession (const BacktestConfig &cfg, MdSource *source, const ParamSchema *schema=nullptr, std::string_view strategy_meta={}) |
| | schema: the strategy's parameters, recorded in cfg.journal_out (may be null).
|
| |
| | ~BacktestSession () |
| |
| | BacktestSession (const BacktestSession &)=delete |
| |
| BacktestSession & | operator= (const BacktestSession &)=delete |
| |
| RunnerDeps & | deps () noexcept |
| |
| sim::SimBackend & | backend () noexcept |
| |
| void | set_param_schedule (sim::ParamSchedule *schedule) noexcept |
| | Parameter updates delivered at simulated times during run() (not owned; may be null).
|
| |
| void | enable_ab (StrategyEntry::PublisherFactory publisher) |
| | [ab] and [strategy.overrides]: builds the run's publisher with publisher (StrategyEntry::publisher), so the overrides reach the engine before the first event and the arms' updates at their times during run().
|
| |
| void | enable_ab (const std::function< std::unique_ptr< ParamPublisher >(ParamSink)> &make_publisher) |
| | enable_ab() with the publisher make_publisher builds on the sink it is given: a strategy whose parameters are not a FASTMM_PARAMS struct (a Python strategy's HotParamTable).
|
| |
| void | set_slow_hooks (const sim::SlowHooks &hooks) noexcept |
| | Code run at simulated times during run() (sim::SimDriver::set_slow_hooks).
|
| |
| BacktestResult | run (const sim::EngineHooks &hooks, IEngineRunner *runner, std::string_view strategy_name) |
| | Runs to the end of the data / horizon.
|
| |
| void | begin (const sim::EngineHooks &hooks, IEngineRunner *runner, const Timestamp *world) |
| | run() in steps, for a multiverse (multiverse.hpp), whose runs share the recorded events and the market data forwarded from them: begin(hooks, runner, &next) leaves the source to the caller, which keeps next at the venue time of the next recorded event (Timestamp::max() when there is none) and for each event its runs share calls advance_before(the event's key) (false: this run is over), then hands it the event: world_event() (or its halves) for a recorded event after the shared SimWorld took its half, shared_market_data() for market data at its arrival.
|
| |
| bool | advance_before (sim::SimKey k) |
| |
| void | world_event (const EventHeader &md) noexcept |
| |
| void | world_venue_event (const EventHeader &md) noexcept |
| |
| void | world_feed_event (const EventHeader &md) noexcept |
| |
| void | shared_market_data (const EventHeader &md) noexcept |
| |
| sim::SimKey | next_key () |
| | The key of this run's own next event or stop (equity bar, markout); never() once it is over.
|
| |
| sim::SimKey | step_key () |
| | After shared_market_data(): the earliest event the engine's step added (SimDriver::step_key).
|
| |
| void | reach (Timestamp t) noexcept |
| | The clock at the last event the run shared (which it may not have had to take).
|
| |
| void | credit_market_data (std::uint64_t n) noexcept |
| | Market data the multiverse did not hand the run, which its engine did not need (SimDriver::credit_market_data).
|
| |
| bool | stopped () const noexcept |
| | The engine asked to stop: the run takes no further event.
|
| |
| BacktestResult | end (std::string_view strategy_name) |
| |
| void | take_record (const EventHeader &record) |
| | A run over a journal that is being followed (backtest/follow_source.hpp): a record of the session it did not have at its start, before the run has reached the record's time.
|
| |
| const FillRows & | fill_rows () const noexcept |
| | What the run has so far: the fills up to the event it last took and the equity bars it has passed.
|
| |
| const EquityRows & | equity_rows () const noexcept |
| |
| std::size_t | forget_rows (std::size_t fills, std::size_t bars) |
| | Returns how many fills it forgot.
|
| |
| std::uint64_t | orders_sent () const noexcept |
| | The order messages the run has sent.
|
| |
| void fastmm::bt::BacktestSession::begin |
( |
const sim::EngineHooks & |
hooks, |
|
|
IEngineRunner * |
runner, |
|
|
const Timestamp * |
world |
|
) |
| |
run() in steps, for a multiverse (multiverse.hpp), whose runs share the recorded events and the market data forwarded from them: begin(hooks, runner, &next) leaves the source to the caller, which keeps next at the venue time of the next recorded event (Timestamp::max() when there is none) and for each event its runs share calls advance_before(the event's key) (false: this run is over), then hands it the event: world_event() (or its halves) for a recorded event after the shared SimWorld took its half, shared_market_data() for market data at its arrival.
end() runs what is left and returns what run() would have. begin(.., nullptr) + end() is run().